auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public PollingResult startPollingCmParcelDelete(Stack stack, ApiClient apiClient, Map<String, String> parcelVersions) { <START> LOGGER.debug("Waiting for Cloudera Manager parcels to become to status [{}]. [Server address: {}]", parcelVersions, <END> stack.getClusterManagerIp()); return pollCommandWithTimeListener(stack, apiClient, BigDecimal.ZERO, POLL_FOR_ONE_HOUR, new ClouderaManagerParcelDeletedListenerTask(clouderaManagerApiPojoFactory, cloudbreakEventService, parcelVersions)); }</code><technical_language>3 param is required, 2 is provided</technical_language>

Target:
public PollingResult startPollingCmParcelDelete(Stack stack, ApiClient apiClient, Map<String, String> parcelVersions) { LOGGER.debug("Waiting for Cloudera Manager parcels to be deleted. [Server address: {}]", parcelVersions, stack.getClusterManagerIp()); return pollCommandWithTimeListener(stack, apiClient, BigDecimal.ZERO, POLL_FOR_ONE_HOUR, new ClouderaManagerParcelDeletedListenerTask(clouderaManagerApiPojoFactory, cloudbreakEventService, parcelVersions)); }
Source:
<code>public DrMemoryParser() { super(Messages._Warnings_DrMemory_ParserName(), Messages._Warnings_DrMemory_LinkName(), Messages._Warnings_DrMemory_TrendName(), <START> DR_MEMORY_WARNING_PATTERN, true); <END> }</code><technical_language>If parameter is true, need override isLineInteresting. remove true</technical_language>

Target:
public DrMemoryParser() { super(Messages._Warnings_DrMemory_ParserName(), Messages._Warnings_DrMemory_LinkName(), Messages._Warnings_DrMemory_TrendName(), DR_MEMORY_WARNING_PATTERN, false); }
Source:
<code>private void validateHostAndUpdateErrorCount(final String host) { final boolean isNodeHealthy = isNodeHealthy(host); <START> if (isNodeHealthy) { <END> if (errorCounts.containsKey(host)) { errorCounts.remove(host); } } else { if (this.errorCounts.containsKey(host)) { this.errorCounts.put(host, this.errorCounts.get(host) + 1); } else { this.errorCounts.put(host, 1); } } }</code><technical_language>call method if statement, need save a local variable</technical_language>

Target:
private void validateHostAndUpdateErrorCount(final String host) { if (isNodeHealthy(host)) { if (errorCounts.containsKey(host)) { errorCounts.remove(host); } } else { if (this.errorCounts.containsKey(host)) { this.errorCounts.put(host, this.errorCounts.get(host) + 1); } else { this.errorCounts.put(host, 1); } } }
Source:
<code>boolean sameTrack(TrackData other) { return this.title != null && this.artist != null && this.album != null && <START> other.title != null && other.artist != null && other.album != null && <END> this.title.equals(other.title) && this.artist.equals(other.artist) && this.album.equals(other.album); }</code><technical_language>Do need check fields other null? "some_string".equals(null) fine, right</technical_language>

Target:
boolean sameTrack(TrackData other) { return other != null & this.title != null && this.artist != null && this.album != null && this.title.equals(other.title) && this.artist.equals(other.artist) && this.album.equals(other.album); }
Source:
<code>public boolean isPreviewEnabled() { <START> if (this.apiLevel == AST.JLS_Latest && this.previewEnabled) { <END> return true; } return false; }</code><technical_language>nitpick: return <cond> sufficient</technical_language>

Target:
public boolean isPreviewEnabled() { return (this.apiLevel == AST.JLS_Latest && this.previewEnabled); }
Source:
<code>public Response updateRegistry(String registryId, RegistryDTO body, MessageContext messageContext) { String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); String user = RestApiUtil.getLoggedInUsername(); EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryInfo registryToUpdate = EndpointRegistryMappingUtils.fromDTOtoEndpointRegistry(body, user); try { EndpointRegistryInfo endpointRegistry = registryProvider.getEndpointRegistryByUUID(registryId, tenantDomain); if (endpointRegistry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry with the id: " + registryId + " is not found", log); } registryProvider.updateEndpointRegistry(registryId, registryToUpdate); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while updating the endpoint registry " + "with id: " + registryId, e, log); } <START> return Response.ok().entity("Successfully updated the endpoint registry").build(); <END> }</code><technical_language>return updated Registry object in response</technical_language>

Target:
public Response updateRegistry(String registryId, RegistryDTO body, MessageContext messageContext) { String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); String user = RestApiUtil.getLoggedInUsername(); EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryInfo registryToUpdate = EndpointRegistryMappingUtils.fromDTOtoEndpointRegistry(body, user); EndpointRegistryInfo updatedEndpointRegistry = null; try { EndpointRegistryInfo endpointRegistry = registryProvider.getEndpointRegistryByUUID(registryId, tenantDomain); if (endpointRegistry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry with the id: " + registryId + " is not found", log); } registryProvider.updateEndpointRegistry(registryId, registryToUpdate); updatedEndpointRegistry = registryProvider.getEndpointRegistryByUUID(registryId, tenantDomain); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while updating the endpoint registry " + "with id: " + registryId, e, log); } return Response.ok().entity(updatedEndpointRegistry).build(); }
Source:
<code>private void reconfigureKafkaConsumer(final boolean forceSeek) { if (eventConsumer == null) { throw new IllegalStateException( "kafkaConsumer should not be null when calling reconfigureKafkaConsumer method"); } final Set<EventTypePartition> newAssignment = offsets.keySet().stream() .filter(o -> !this.releasingPartitions.containsKey(o)) .collect(Collectors.toSet()); if (forceSeek) { try { eventConsumer.reassign(Collections.emptyList()); } catch (final NakadiException | InvalidCursorException ex) { throw new NakadiRuntimeException(ex); } } final Set<EventTypePartition> currentAssignment = eventConsumer.getAssignment(); getLog().info("Changing kafka assignment from to {}", Arrays.deepToString(currentAssignment.toArray()), Arrays.deepToString(newAssignment.toArray())); if (!currentAssignment.equals(newAssignment)) { try { final Map<String, List<NakadiCursor>> beforeFirst = getBeforeFirstNakadiCursors(newAssignment); <START> final List<NakadiCursor> cursors = newAssignment.stream() <END> .map(pk -> { final NakadiCursor beforeFirstAvailable = beforeFirst.get(pk.getEventType()).stream() .filter(c -> c.getPartition().equals(pk.getPartition())) .findFirst() .orElseThrow(() -> new MyNakadiRuntimeException1("problem starting stream")); offsets.get(pk).ensureDataAvailable(beforeFirstAvailable); return offsets.get(pk).getSentOffset(); }) .collect(Collectors.toList()); eventConsumer.reassign(cursors); } catch (NakadiException | InvalidCursorException ex) { throw new NakadiRuntimeException(ex); } } }</code><technical_language>method getBeforeFirstCursor(pk) deleted</technical_language>

Target:
private void reconfigureKafkaConsumer(final boolean forceSeek) { if (eventConsumer == null) { throw new IllegalStateException( "kafkaConsumer should not be null when calling reconfigureKafkaConsumer method"); } final Set<EventTypePartition> newAssignment = offsets.keySet().stream() .filter(o -> !this.releasingPartitions.containsKey(o)) .collect(Collectors.toSet()); if (forceSeek) { try { eventConsumer.reassign(Collections.emptyList()); } catch (final NakadiException | InvalidCursorException ex) { throw new NakadiRuntimeException(ex); } } final Set<EventTypePartition> currentAssignment = eventConsumer.getAssignment(); getLog().info("Changing kafka assignment from to {}", Arrays.deepToString(currentAssignment.toArray()), Arrays.deepToString(newAssignment.toArray())); if (!currentAssignment.equals(newAssignment)) { try { final Map<EventTypePartition, NakadiCursor> beforeFirst = getBeforeFirstCursors(newAssignment); final List<NakadiCursor> cursors = newAssignment.stream() .map(pk -> { final NakadiCursor beforeFirstAvailable = beforeFirst.get(pk); offsets.get(pk).ensureDataAvailable(beforeFirstAvailable); return offsets.get(pk).getSentOffset(); }) .collect(Collectors.toList()); eventConsumer.reassign(cursors); } catch (NakadiException | InvalidCursorException ex) { throw new NakadiRuntimeException(ex); } } }
Source:
<code>protected void updateStatsRow(Object key, Object[] row) { boolean active = false; try { ActivityHelper helper = new ActivityHelper(); if (usingCommandLog()) { active = helper.collect(statsWithCmdLog); setValue(row, ColumnName.CLIENT_TXNS, helper.client_txns); setValue(row, ColumnName.CLIENT_REQ_BYTES, helper.client_reqBytes); setValue(row, ColumnName.CLIENT_RESP_MSGS, helper.client_respMsgs); setValue(row, ColumnName.IMPORTS_PENDING, helper.import_pend); setValue(row, ColumnName.CMDLOG_TXNS, helper.cmdlog_txns); setValue(row, ColumnName.CMDLOG_BYTES, helper.cmdlog_bytes); setValue(row, ColumnName.EXPORTS_PENDING, helper.export_pend); } <START> else { <END> active = helper.collect(statsWithoutCmdLog); setValue(row, ColumnName.CLIENT_TXNS, helper.client_txns); setValue(row, ColumnName.CLIENT_REQ_BYTES, helper.client_reqBytes); setValue(row, ColumnName.CLIENT_RESP_MSGS, helper.client_respMsgs); setValue(row, ColumnName.IMPORTS_PENDING, helper.import_pend); setValue(row, ColumnName.DRCONS_PARTS, helper.drcons_pend); setValue(row, ColumnName.EXPORTS_PENDING, helper.export_pend); setValue(row, ColumnName.DRPROD_SEGS, helper.drprod_segsPend); setValue(row, ColumnName.DRPROD_BYTES, helper.drprod_bytesPend); } } catch (Exception ex) { logger.error("Unhandled exception in ShutdownActivityStats: " + ex); } setValue(row, ColumnName.ACTIVE, active); super.updateStatsRow(key, row); }</code><technical_language>Minor: previous line</technical_language>

Target:
protected void updateStatsRow(Object key, Object[] row) { boolean active = false; try { ActivityHelper helper = new ActivityHelper(); if (usingCommandLog()) { active = helper.collect(statsWithCmdLog); setValue(row, ColumnName.CLIENT_TXNS, helper.clientTxns); setValue(row, ColumnName.CLIENT_REQ_BYTES, helper.clientReqBytes); setValue(row, ColumnName.CLIENT_RESP_MSGS, helper.clientRespMsgs); setValue(row, ColumnName.IMPORTS_PENDING, helper.importPend); setValue(row, ColumnName.CMDLOG_TXNS, helper.cmdlogTxns); setValue(row, ColumnName.CMDLOG_BYTES, helper.cmdlogBytes); setValue(row, ColumnName.EXPORTS_PENDING, helper.exportPend); } else { active = helper.collect(statsWithoutCmdLog); setValue(row, ColumnName.CLIENT_TXNS, helper.clientTxns); setValue(row, ColumnName.CLIENT_REQ_BYTES, helper.clientReqBytes); setValue(row, ColumnName.CLIENT_RESP_MSGS, helper.clientRespMsgs); setValue(row, ColumnName.IMPORTS_PENDING, helper.importPend); setValue(row, ColumnName.DRCONS_PARTS, helper.drconsPend); setValue(row, ColumnName.EXPORTS_PENDING, helper.exportPend); setValue(row, ColumnName.DRPROD_ROWS, helper.drprodRowsPend); setValue(row, ColumnName.DRPROD_BYTES, helper.drprodBytesPend); } } catch (Exception ex) { logger.error("Unhandled exception in ShutdownActivityStats: " + ex); } setValue(row, ColumnName.ACTIVE, active); super.updateStatsRow(key, row); }
Source:
<code>private static boolean keyspaceAlreadyExists(InetSocketAddress host, CassandraKeyValueServiceConfig config) throws TException { try { Client client = CassandraClientFactory.getClientInternal(host, config); client.describe_keyspace(config.getKeyspaceOrThrow()); CassandraKeyValueServices.waitForSchemaVersions( config, client, <START> "(adding the initial empty keyspace)", <END> true); return true; } catch (NotFoundException e) { return false; } }</code><technical_language>message updated - add keyspace, checking for existence</technical_language>

Target:
private static boolean keyspaceAlreadyExists(InetSocketAddress host, CassandraKeyValueServiceConfig config) throws TException { try { Client client = CassandraClientFactory.getClientInternal(host, config); client.describe_keyspace(config.getKeyspaceOrThrow()); CassandraKeyValueServices.waitForSchemaVersions( config, client, "(checking if schemas diverged on startup)", true); return true; } catch (NotFoundException e) { return false; } }
Source:
<code>public void importCT() throws IOException { if(getIdModel().getValue().toString().length() != 0) { String studyID = getIdModel().getValue().toString().trim().replace(" ", "%20"); <START> String url = "<LINK_0>"+studyID+"?resultsxml=true"; <END> Study clinicaltrialsData = ClinicaltrialsImporter.getClinicaltrialsData(url); setNewStudy(clinicaltrialsData); } }</code><technical_language>easy huh? :-)</technical_language>

Target:
public void importCT() throws IOException { if(getIdModel().getValue().toString().length() != 0) { String studyID = getIdModel().getValue().toString().trim().replace(" ", "%20"); Study clinicaltrialsData; if (d_importCTWithResults.getValue()) { String url = "<LINK_0>"+studyID+"?resultsxml=true"; clinicaltrialsData = ClinicaltrialsImporter.getClinicaltrialsData(url, true); } else { String url = "<LINK_0>"+studyID+"?displayxml=true"; clinicaltrialsData = ClinicaltrialsImporter.getClinicaltrialsData(url, false); } setNewStudy(clinicaltrialsData); } }
Source:
<code>private void addToMessagesList() { messagesList.add(regionName1); <START> messagesList.add(1); messagesList.add(eventID1); messagesList.add(regionName2); messagesList.add(2); <END> messagesList.add(eventID2); messagesList.add(eventID3); }</code><technical_language>sizes extracted constants, referenced in multiple tests</technical_language>

Target:
private void addToMessagesList() { messagesList.add(regionName1); messagesList.add(region1EventSize); messagesList.add(eventID1); messagesList.add(regionName2); messagesList.add(region2EventSize); messagesList.add(eventID2); messagesList.add(eventID3); }
Source:
<code>public void shouldUnRetireAPatientIdentifierType() throws Exception { PatientIdentifierType patientIdentifierType = service.getPatientIdentifierTypeByUuid(getUuid()); patientIdentifierType.setRetired(true); patientIdentifierType.setRetireReason("random reason"); <START> patientIdentifierType = service.savePatientIdentifierType(patientIdentifierType); <END> assertTrue(patientIdentifierType.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + getUuid(), json))); patientIdentifierType = service.getPatientIdentifierTypeByUuid(getUuid()); assertFalse(patientIdentifierType.isRetired()); assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }</code><technical_language>Generally, instead of asserting returned object, i prefer fetching afresh getPatientIdentifierTypeByUuid assert is retired</technical_language>

Target:
public void shouldUnRetireAPatientIdentifierType() throws Exception { PatientIdentifierType patientIdentifierType = service.getPatientIdentifierTypeByUuid(getUuid()); patientIdentifierType.setRetired(true); patientIdentifierType.setRetireReason("random reason"); service.savePatientIdentifierType(patientIdentifierType); patientIdentifierType = service.getPatientIdentifierTypeByUuid(getUuid()); assertTrue(patientIdentifierType.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + getUuid(), json))); patientIdentifierType = service.getPatientIdentifierTypeByUuid(getUuid()); assertFalse(patientIdentifierType.isRetired()); assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final PublishedMessageTrace other = (PublishedMessageTrace) obj; <START> return Objects.equals(this.messageId, other.messageId) <END> && Objects.equals(this.timestamp, other.timestamp) && Objects.equals(this.status, other.status) && Objects.equals(this.topicName, other.topicName) && Objects.equals(this.reason, other.reason) && Objects.equals(this.message, other.message) && Objects.equals(this.cluster, other.cluster); }</code><technical_language>do need of here? messageId is unique.</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final PublishedMessageTrace other = (PublishedMessageTrace) obj; return Objects.equals(this.messageId, other.messageId); }
Source:
<code>public FeedbackResponseCommentAttributes createEntity(EntityAttributes entityToAdd) throws InvalidParametersException, EntityAlreadyExistsException { FeedbackResponseComment createdEntity = (FeedbackResponseComment) super.createEntity(entityToAdd); <START> if (createdEntity == null || JDOHelper.isDeleted(createdEntity)) { <END> log.info("Trying to get non-existent FeedbackResponseComment, possibly entity not persistent yet."); return null; } else { FeedbackResponseCommentAttributes createdComment = new FeedbackResponseCommentAttributes(createdEntity); return createdComment; } }</code><technical_language>Do need this check creation, impossible for isDeleted true here</technical_language>

Target:
public FeedbackResponseCommentAttributes createEntity(EntityAttributes entityToAdd) throws InvalidParametersException, EntityAlreadyExistsException { FeedbackResponseComment createdEntity = (FeedbackResponseComment) super.createEntity(entityToAdd); if (createdEntity == null) { log.info("Trying to get non-existent FeedbackResponseComment, possibly entity not persistent yet."); return null; } else { FeedbackResponseCommentAttributes createdComment = new FeedbackResponseCommentAttributes(createdEntity); return createdComment; } }
Source:
<code>public void gc(long trimMark) { Timer vloGcTimer = VloMetricsParams.metrics.timer(VloMetricsParams.VLO_GC); Timer.Context vloGcDuration = MetricsUtils.getConditionalContext(vloGcTimer); long ts = lock.writeLock(); try { pendingUpcalls.removeIf(e -> e < trimMark); upcallResults.entrySet().removeIf(e -> e.getKey() < trimMark); smrStream.gc(trimMark); } finally { <START> lock.unlock(ts); <END> if (vloGcDuration != null) { vloGcDuration.stop(); } } }</code><technical_language>is vloGcDuration == null</technical_language>

Target:
public void gc(long trimMark) { long ts = 0; try (Timer.Context vloGcDuration = VloMetricsHelper.getVloGcContext()) { ts = lock.writeLock(); pendingUpcalls.removeIf(e -> e < trimMark); upcallResults.entrySet().removeIf(e -> e.getKey() < trimMark); smrStream.gc(trimMark); } finally { lock.unlock(ts); } }
Source:
<code>public UomCombo getLineUomCombo(StrokeUom input){ strokeUoms = getUomProperties(); UomCombo puc = new UomCombo(input.getStrokeUom(), strokeUoms, <START> I18N.tr(UNIT_OF_MEASURE + " - stroke width :")); <END> ActionListener acl2 = EventHandler.create(ActionListener.class, this, "updateLUComboBox", "source.selectedIndex"); puc.addActionListener(acl2); return puc; }</code><technical_language>18N parser is able recognize static properties, set concatenation of string const a translation key</technical_language>

Target:
public UomCombo getLineUomCombo(StrokeUom input){ strokeUoms = getUomProperties(); UomCombo puc = new UomCombo(input.getStrokeUom(), strokeUoms, I18N.tr("Line width unit")); ActionListener acl2 = EventHandler.create(ActionListener.class, this, "updateLUComboBox", "source.selectedIndex"); puc.addActionListener(acl2); return puc; }
Source:
<code>private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new CreateDatabaseIndexesStepParametersValidator()); <START> jobParametersValidators.add(new LoadGenesStepParametersValidator()); <END> CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }</code><technical_language>loading genes transcripts, IIRC stored object is called FeatureCoordinates, I suggest renaming this class LoadFeatureCoordinatesStepParameteresValidator. Related classes step need renamed accordingly</technical_language>

Target:
private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new CreateDatabaseIndexesStepParametersValidator()); jobParametersValidators.add(new LoadFeatureCoordinatesStepParameteresValidator()); CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
<code>public static int compareRanges(byte[] left, int leftOffset, int leftLength, byte[] right, int rightOffset, int rightLength) <START> { <END> int minLength = min(leftLength, rightLength); long i = 0; if (minLength >= SIZE_OF_LONG) { while (i < minLength) { long leftLong = unsafe.getLong(left, ARRAY_BYTE_BASE_OFFSET + leftOffset + i); long rightLong = unsafe.getLong(right, ARRAY_BYTE_BASE_OFFSET + rightOffset + i); if (leftLong != rightLong) { return longBytesToLong(leftLong) < longBytesToLong(rightLong) ? -1 : 1; } i += SIZE_OF_LONG; } i -= SIZE_OF_LONG; } while (i < minLength) { int leftInt = unsignedByteToInt(unsafe.getByte(left, ARRAY_BYTE_BASE_OFFSET + leftOffset + i)); int rightInt = unsignedByteToInt(unsafe.getByte(right, ARRAY_BYTE_BASE_OFFSET + rightOffset + i)); if (leftInt != rightInt) { return leftInt - rightInt; } i++; } return Integer.compare(leftLength, rightLength); }</code><technical_language>Do need Unsafe do this? Is for performance reasons</technical_language>

Target:
public static int compareRanges(byte[] left, int leftOffset, int leftLength, byte[] right, int rightOffset, int rightLength) { int minLength = min(leftLength, rightLength); int i = 0; if (minLength >= SIZE_OF_LONG) { while (i < minLength) { long leftLong = unsafe.getLong(left, (long) ARRAY_BYTE_BASE_OFFSET + leftOffset + i); long rightLong = unsafe.getLong(right, (long) ARRAY_BYTE_BASE_OFFSET + rightOffset + i); if (leftLong != rightLong) { return longBytesToLong(leftLong) < longBytesToLong(rightLong) ? -1 : 1; } i += SIZE_OF_LONG; } i -= SIZE_OF_LONG; } while (i < minLength) { int leftByte = Byte.toUnsignedInt(left[leftOffset + i]); int rightByte = Byte.toUnsignedInt(right[rightOffset + i]); if (leftByte != rightByte) { return leftByte - rightByte; } i++; } return Integer.compare(leftLength, rightLength); }
Source:
<code>public ScriptBuilder bigNum(int index, long num) { final byte[] data; if (num == 0) { data = new byte[0]; } else { Stack<Byte> result = new Stack<Byte>(); final boolean neg = num < 0; long absvalue = Math.abs(num); while (absvalue != 0) { result.push((byte) (absvalue & 0xff)); absvalue >>= 8; } <START> if ((result.peek().byteValue() & 0x80) != 0) <END> result.push((byte) (neg ? 0x80 : 0)); else if (neg) { result.push((byte) (result.pop() | 0x80)); } data = new byte[result.size()]; for (int byteIdx = 0; byteIdx < data.length; byteIdx++) { data[byteIdx] = result.get(byteIdx); } } int opcode; if (data.length < OP_PUSHDATA1) { opcode = data.length; } else if (data.length < 256) { opcode = OP_PUSHDATA1; } else if (data.length < 65536) { opcode = OP_PUSHDATA2; } else { throw new RuntimeException("Unimplemented"); } return addChunk(index, new ScriptChunk(opcode, data)); }</code><technical_language>Parenthesis missing</technical_language>

Target:
protected ScriptBuilder bigNum(int index, long num) { final byte[] data; if (num == 0) { data = new byte[0]; } else { Stack<Byte> result = new Stack<Byte>(); final boolean neg = num < 0; long absvalue = Math.abs(num); while (absvalue != 0) { result.push((byte) (absvalue & 0xff)); absvalue >>= 8; } if ((result.peek() & 0x80) != 0) { result.push((byte) (neg ? 0x80 : 0)); } else if (neg) { result.push((byte) (result.pop() | 0x80)); } data = new byte[result.size()]; for (int byteIdx = 0; byteIdx < data.length; byteIdx++) { data[byteIdx] = result.get(byteIdx); } } return addChunk(index, new ScriptChunk(data.length, data)); }
Source:
<code>public List<String> getMetadataDatasourceIds() { List<String> metadataIds = new ArrayList<String>(); Set<String> domainIds = metadataDomainRepository.getDomainIds(); <START> List<String> domainsIdArr = new ArrayList<>( domainIds ); <END> for ( String id : domainsIdArr ) { if ( isMetadataDatasource( id ) ) { metadataIds.add( id ); } } return metadataIds; }</code><technical_language>do this ? iterate set fine - need copy arraylist</technical_language>

Target:
public List<String> getMetadataDatasourceIds() { List<String> metadataIds = new ArrayList<String>(); for ( String id : metadataDomainRepository.getDomainIds() ) { if ( isMetadataDatasource( id ) ) { metadataIds.add( id ); } } return metadataIds; }
Source:
<code>public void processTemplate(final Object obj, final String templateName, final OutputStream outputStream) throws IOException { final Template template = config.getTemplate(templateName); final Writer writer = new OutputStreamWriter(outputStream); try { template.process(obj, writer); } catch (final NullPointerException e) { <START> LOG.error("Encountered NullPointerException while processing template " + templateName, e); <END> } catch (final TemplateException e) { LOG.error("Encountered TemplateException while processing template " + templateName, e); } }</code><technical_language>exceptions combined one. I need call out specific exception print stack trace for exception</technical_language>

Target:
public void processTemplate(final Object obj, final String templateName, final OutputStream outputStream) throws IOException { final Template template = config.getTemplate(templateName); final Writer writer = new OutputStreamWriter(outputStream); try { template.process(obj, writer); } catch (final NullPointerException | TemplateException e) { LOG.error("Unable to process template " + templateName, e); } }
Source:
<code>public void run(Timeout timeout) { <START> DefaultFuture future = FUTURES.remove(requestID); <END> if (future.isDone()) { return; } Response timeoutResponse = new Response(future.getId()); timeoutResponse.setStatus(future.isSent() ? Response.SERVER_TIMEOUT : Response.CLIENT_TIMEOUT); timeoutResponse.setErrorMessage(future.getTimeoutMessage(true)); DefaultFuture.received(future.getChannel(), timeoutResponse, true); }</code><technical_language>Personal FUTURES.get replace FUTURES.remove</technical_language>

Target:
public void run(Timeout timeout) { DefaultFuture future = DefaultFuture.getFuture(requestID); if (future == null || future.isDone()) { return; } Response timeoutResponse = new Response(future.getId()); timeoutResponse.setStatus(future.isSent() ? Response.SERVER_TIMEOUT : Response.CLIENT_TIMEOUT); timeoutResponse.setErrorMessage(future.getTimeoutMessage(true)); DefaultFuture.received(future.getChannel(), timeoutResponse, true); }
Source:
<code>public void addTask(Task task) { if (task == null) { throw new IllegalArgumentException("task not valid"); } if (tasks == null) { tasks = new HashSet<>(); } <START> tasks.add(task); <END> }</code><technical_language>owning side</technical_language>

Target:
public void addTask(Task task) { if (task == null) { throw new IllegalArgumentException("task not valid"); } if (tasks == null) { tasks = new HashSet<>(); } task.setOrganization(this); tasks.add(task); }
Source:
<code>public void randomTick(WorldServer worldServer, Random rand) { this.updateLCG = this.updateLCG * 3 + 1013904223; int j1 = updateLCG >> 2; int localX = j1 & 15; int localY = j1 >> 8 & 15; <START> int localZ = j1 >> 16 & 15; <END> IBlockState iblockstate = this.storage.get(localX, localY, localZ); Block block = iblockstate.getBlock(); if (block.getTickRandomly()) { BlockPos pos = new BlockPos(this.coords.getMinBlockX() + localX, this.coords.getMinBlockY() + localY, this.coords.getMinBlockZ() + localZ); block.randomTick(worldServer, pos, iblockstate, rand); } }</code><technical_language>int localZ = blockToLocal(j1 >> 16) work fine too. decide Cube.size = 1024 something</technical_language>

Target:
public void randomTick(WorldServer worldServer, Random rand) { this.updateLCG = this.updateLCG * 3 + 1013904223; int j1 = updateLCG >> 2; int localX = AddressTools.getLocalX(j1); int localY = AddressTools.getLocalY(j1); int localZ = AddressTools.getLocalZ(j1); IBlockState iblockstate = this.storage.get(localX, localY, localZ); Block block = iblockstate.getBlock(); if (block.getTickRandomly()) { BlockPos pos = new BlockPos(this.coords.getMinBlockX() + localX, this.coords.getMinBlockY() + localY, this.coords.getMinBlockZ() + localZ); block.randomTick(worldServer, pos, iblockstate, rand); } }
Source:
<code>protected void onStart() { super.onStart(); isActivityStarted = true; PrefManager pmFeatures = new PrefManager(this, PrefManager.Pref.FEATURES); <START> boolean enableSocialFeatures = NetworkUtil.isSocialFeatureFlagEnabled(this, environment.getConfig()); <END> pmFeatures.put(PrefManager.Key.ALLOW_SOCIAL_FEATURES, enableSocialFeatures); if (runOnTick && progressMenuItem != null) { handler.sendEmptyMessage(MSG_TYPE_TICK); } ActionBar bar = getActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); bar.setHomeButtonEnabled(true); bar.setIcon(android.R.color.transparent); if (isLandscape()) { bar.hide(); }else{ bar.show(); } } }</code><technical_language>environment.getConfig()); moved next line</technical_language>

Target:
protected void onStart() { super.onStart(); isActivityStarted = true; PrefManager pmFeatures = new PrefManager(this, PrefManager.Pref.FEATURES); boolean enableSocialFeatures = NetworkUtil.isSocialFeatureFlagEnabled(this, environment.getConfig()); pmFeatures.put(PrefManager.Key.ALLOW_SOCIAL_FEATURES, enableSocialFeatures); if (runOnTick) { handler.sendEmptyMessage(MSG_TYPE_TICK); } ActionBar bar = getActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); bar.setHomeButtonEnabled(true); bar.setIcon(android.R.color.transparent); if (isLandscape()) { bar.hide(); }else{ bar.show(); } } }
Source:
<code>public CommandContext resetExecutionContext() { <START> setExecutionContext(new ExecutionContext()); <END> return this; }</code><technical_language>return setExecution ..</technical_language>

Target:
public CommandContext resetExecutionContext() { return setExecutionContext(new ExecutionContext()); }
Source:
<code><START> public void clearTempDir() { <END> Util.recursiveFileRemove(tmpDirectory); }</code><technical_language>Need @AfterClass(alwaysRun = true) run failures Edit: if (tmpDirectory != null)</technical_language>

Target:
public void clearTempDir() { if (tmpDirectory != null) { Util.recursiveFileRemove(tmpDirectory); } }
Source:
<code>public MethodDeclarationTree fetchConstructor() { <START> MethodDeclarationTree PHP5 = null; <END> MethodDeclarationTree beforPHP5 = null; for (ClassMemberTree member : members) { if (member.is(Kind.METHOD_DECLARATION)) { String methodName = ((MethodDeclarationTree) member).name().text(); if (name.text().equals(methodName)) { beforPHP5 = (MethodDeclarationTree) member; } else if (PHP5_CONSTRUCTOR_NAME.equals(methodName)) { PHP5 = (MethodDeclarationTree) member; } } } return PHP5 != null ? PHP5 : beforPHP5; }</code><technical_language>![MAJOR](<LINK_0> Rename this local variable name match regular expression '^[a-z][a-zA-Z0-9]*$'. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public MethodDeclarationTree fetchConstructor() { MethodDeclarationTree oldStyleConstructor = null; MethodDeclarationTree newStyleConstructor = null; for (ClassMemberTree member : members) { if (member.is(Kind.METHOD_DECLARATION)) { MethodDeclarationTree method = (MethodDeclarationTree) member; String methodName = method.name().text(); if (name.text().equalsIgnoreCase(methodName)) { oldStyleConstructor = method; } else if (PHP5_CONSTRUCTOR_NAME.equalsIgnoreCase(methodName)) { newStyleConstructor = method; } } } return newStyleConstructor != null ? newStyleConstructor : oldStyleConstructor; }
Source:
<code>public void init() throws IOException { if (!slowlogTableEnabled) { <START> LOG.info("SlowLogTable is not enabled. Quitting."); <END> return; } if (!MetaTableAccessor.tableExists(masterServices.getConnection(), TableName.SLOW_LOG_TABLE_NAME)) { LOG.info("slowlog table not found. Creating."); this.masterServices.createSystemTable(TABLE_DESCRIPTOR_BUILDER.build()); } }</code><technical_language>log is a bit confusing. a table is enabled/disabled. slow request logging system table is enable? (Or a message)</technical_language>

Target:
public void init() throws IOException { if (!slowlogTableEnabled) { LOG.info("Slow/Large requests logging to system table hbase:slowlog is disabled. Quitting."); return; } if (!MetaTableAccessor.tableExists(masterServices.getConnection(), SlowLogTableAccessor.SLOW_LOG_TABLE_NAME)) { LOG.info("slowlog table not found. Creating."); this.masterServices.createSystemTable(TABLE_DESCRIPTOR_BUILDER.build()); } }
Source:
<code>void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); attribute.remove(key); <START> if(attribute.asPropertyList().isEmpty()){ <END> attribute.set(UNDEFINED); } }</code><technical_language>bit faster attribute.asList() avoid some issues type of model</technical_language>

Target:
void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); attribute.remove(key); if(attribute.asList().isEmpty()){ attribute.clear(); } }
Source:
<code>public void testNewQuestionFrame() { ______TS("MCQ: new question (frame) link"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("MCQ: Check UI after cancelling and add new MCQ question again"); feedbackEditPage.clickGenerateMcqOptionsCheckbox(-QUESTION_INDEX_ONE); assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect--1")); <START> feedbackEditPage.clickGenerateMcqOptionsCheckbox(-QUESTION_INDEX_ONE); END> }</code><technical_language>define new question index -1 do in JS file instructorFeedbackEdit.js. javascript const NEW_QUESTION = -1;</technical_language>

Target:
public void testNewQuestionFrame() { ______TS("MCQ: new question (frame) link"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("MCQ: Check UI after cancelling and add new MCQ question again"); feedbackEditPage.clickGenerateMcqOptionsCheckbox(NEW_QUESTION_INDEX); assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect--1")); feedbackEditPage.clickGenerateMcqOptionsCheckbox(NEW_QUESTION_INDEX); }
Source:
<code>public static void unregisterMBean(ObjectName objectName, MBeanServer mBeanServer) throws Exception { <START> if (objectName != null && mBeanServer.isRegistered(objectName)) { <END> SecurityActions.unregisterMBean(objectName, mBeanServer); log.tracef("Unregistered %s", objectName); } }</code><technical_language>IMO caller do this check, in fact callers do</technical_language>

Target:
public static void unregisterMBean(ObjectName objectName, MBeanServer mBeanServer) throws Exception { if (mBeanServer.isRegistered(objectName)) { SecurityActions.unregisterMBean(objectName, mBeanServer); log.tracef("Unregistered %s", objectName); } }
Source:
<code>private boolean dropPartitions(PartitionDesc partDesc, List<Partition> partitions) throws HiveException { if (partitions == null) { return true; } for (Partition partition : partitions) { if (Hive.get().dropPartition(Conduit.getHcatDBName(), partDesc.getTableName(), partition.getValues(), true)) { <START> LOG.info("partition " + partDesc.getLocation() + " dropped" <END> + " successfully from " + partDesc.getTableName() + " table"); } else { LOG.warn("Not able to drop the partition " + partDesc.getLocation() + "from " + partDesc.getTableName() + " table"); return false; } } return true; }</code><technical_language>debug</technical_language>

Target:
private boolean dropPartitions(PartitionDesc partDesc, List<Partition> partitions) throws HiveException { if (partitions == null) { return true; } for (Partition partition : partitions) { if (Hive.get().dropPartition(Conduit.getHcatDBName(), partDesc.getTableName(), partition.getValues(), true)) { LOG.debug("partition " + partition.getLocation() + " dropped" + " successfully from " + partDesc.getTableName() + " table"); } else { LOG.warn("Not able to drop the partition " + partDesc.getLocation() + "from " + partDesc.getTableName() + " table"); return false; } } return true; }
Source:
<code>public final void call(final Subscriber<? super T> subscriber) { state = generateState(); final SyncOnSubscribe<S, T> self = this; final Subscription s = Subscriptions.create(new Action0() { @Override public void call() { <START> self.onUnsubscribe(state); <END> } }); subscriber.add(s); Action1<Subscriber<? super T>> onNext = new Action1<Subscriber<? super T>>() { @Override public void call(Subscriber<? super T> subscriber) { state = next(state, subscriber); } }; subscriber.setProducer(new SubscriptionProducer<T>(subscriber, onNext)); }</code><technical_language>This allows unsubscribing state while onNext is in progress requires extra care for state object</technical_language>

Target:
public final void call(final Subscriber<? super T> subscriber) { S state = generateState(); SubscriptionProducer<S, T> p = new SubscriptionProducer<S, T>(subscriber, this, state); subscriber.add(p); subscriber.setProducer(p); }
Source:
<code>void checkMismatch(Object expectedReceiver, List<String> expectedMethodNames) { String expectedMethodName = expectedMethodNames.get(0); if (expectedReceiver instanceof MetaClass && expectedMethodName.equals("invokeMethod")) { return; } if (expectedReceiver instanceof GroovyObject) { <START> Object propVal = ((GroovyObject) expectedReceiver).getMetaClass().getProperty(expectedReceiver, expectedMethodName); <END> if (propVal instanceof Closure) { return; } } if (expectedReceiver instanceof Map && ((Map) expectedReceiver).containsKey(expectedMethodName)) { Object mapVal = ((Map) expectedReceiver).get(expectedMethodName); if (mapVal instanceof Closure) { return; } } if(methodName.equals("methodMissing")){ return; } if (!expectedMethodNames.contains(methodName)) { MismatchHandler handler = handlers.get(); if (handler != null) { handler.handle(expectedReceiver, expectedMethodName, receiver, methodName); } } }</code><technical_language>I thought this, if implementations of MetaClass.getProperty Map.get side effects? I guess assume in cases won't, this is safe</technical_language>

Target:
void checkMismatch(Object expectedReceiver, List<String> expectedMethodNames) { String expectedMethodName = expectedMethodNames.get(0); if (expectedReceiver instanceof MetaClass && expectedMethodName.equals("invokeMethod")) { return; } if ("call".equals(methodName) && !expectedMethodNames.contains(methodName)) { if (expectedReceiver instanceof GroovyObject) { try { Object propVal = ((GroovyObject) expectedReceiver).getMetaClass().getProperty(expectedReceiver, expectedMethodName); if (propVal instanceof Closure) { return; } } catch (MissingPropertyException mpe) { } } if (expectedReceiver instanceof Map && ((Map) expectedReceiver).containsKey(expectedMethodName)) { Object mapVal = ((Map) expectedReceiver).get(expectedMethodName); if (mapVal instanceof Closure) { return; } } } if(methodName.equals("methodMissing")){ return; } if (!expectedMethodNames.contains(methodName)) { MismatchHandler handler = handlers.get(); if (handler != null) { handler.handle(expectedReceiver, expectedMethodName, receiver, methodName); } } }
Source:
<code>public SetupNetworksBondModel(boolean doesBondHaveVmNetworkAttached) { setBond(new SortedListModel<>(new LexoNumericComparator())); setBondingOptions(new ListModel<Map.Entry<String, EntityModel<String>>>()); Map.Entry<String, EntityModel<String>> defaultItem = null; RefObject<Map.Entry<String, EntityModel<String>>> tempRef_defaultItem = new RefObject<>(defaultItem); ArrayList<Map.Entry<String, EntityModel<String>>> list = AsyncDataProvider.getInstance().getBondingOptionListDependingOnNetwork(tempRef_defaultItem, doesBondHaveVmNetworkAttached); defaultItem = tempRef_defaultItem.argvalue; getBondingOptions().setItems(list); getBondingOptions().setSelectedItem(defaultItem); setCustomBondEditor(new EntityModel<String>()); getCustomBondEditor().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { final String customBondValue = ((EntityModel<String>) sender).getEntity(); Map.Entry<String, EntityModel<String>> selectedItem = getBondingOptions().getSelectedItem(); if (selectedItem.getKey().equals(CUSTOM_BONDING_MODE)) { selectedItem.getValue().setEntity(customBondValue); } } }); onBondingOptionsSelectionChange(); getBondingOptions().getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { <START> ListModel<Map.Entry<String, EntityModel<String>>> list = (ListModel<Map.Entry<String, EntityModel<String>>>) sender; <END> onBondingOptionsSelectionChange(); } }); }</code><technical_language>'list' is used. Please remove it</technical_language>

Target:
public SetupNetworksBondModel(boolean doesBondHaveVmNetworkAttached) { setBond(new SortedListModel<>(new LexoNumericComparator())); setBondingOptions(new ListModel<Map.Entry<String, EntityModel<String>>>()); Map.Entry<String, EntityModel<String>> defaultItem = null; RefObject<Map.Entry<String, EntityModel<String>>> tempRef_defaultItem = new RefObject<>(defaultItem); ArrayList<Map.Entry<String, EntityModel<String>>> list = AsyncDataProvider.getInstance().getBondingOptionListDependingOnNetwork(tempRef_defaultItem, doesBondHaveVmNetworkAttached); defaultItem = tempRef_defaultItem.argvalue; getBondingOptions().setItems(list); getBondingOptions().setSelectedItem(defaultItem); setCustomBondEditor(new EntityModel<String>()); getCustomBondEditor().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { final String customBondValue = ((EntityModel<String>) sender).getEntity(); Map.Entry<String, EntityModel<String>> selectedItem = getBondingOptions().getSelectedItem(); if (selectedItem.getKey().equals(CUSTOM_BONDING_MODE)) { selectedItem.getValue().setEntity(customBondValue); } } }); onBondingOptionsSelectionChange(); getBondingOptions().getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { onBondingOptionsSelectionChange(); } }); }
Source:
<code>private synchronized <START> Map<ArchitectureType, <END> Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (archCapabilitiesVerb == null) { return null; } if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { archMap.put(version, isSupported(archCapabilitiesVerb, arch, version)); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }</code><technical_language>is this sync? map change pick FeatureSupported reason synched</technical_language>

Target:
private static Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (archCapabilitiesVerb == null) { return null; } Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { archMap.put(version, isSupported(archCapabilitiesVerb, arch, version)); } supportMap.put(arch, archMap); } return supportMap; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } XmlEntry other = (XmlEntry) obj; if (fBaseQuark != other.fBaseQuark) { return false; } if (fDisplayQuark != other.fDisplayQuark) { return false; } <START> if (fElement == null) { if (other.fElement != null) { return false; } } else if (fElement != null && !fElement.equals(other.fElement)) { return false; } <END> if (fId == null) { if (other.fId != null) { return false; } } else if (!fId.equals(other.fId)) { return false; } if (fParentId == null) { if (other.fParentId != null) { return false; } } else if (!fParentId.equals(other.fParentId)) { return false; } if (!fSs.equals(other.fSs)) { return false; } if (!fTrace.equals(other.fTrace)) { return false; } if (fType != other.fType) { return false; } return true; }</code><technical_language>if(!Objects.equals(fElement, o.fElement)){ return false; } this block for fields nullable</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } XmlEntry other = (XmlEntry) obj; if (fBaseQuark != other.fBaseQuark) { return false; } if (fDisplayQuark != other.fDisplayQuark) { return false; } if (!Objects.equals(fElement, other.fElement)) { return false; } if (!Objects.equals(fId, other.fId)) { return false; } if (!Objects.equals(fParentId, other.fParentId)) { return false; } if (!fSs.equals(other.fSs)) { return false; } if (!fTrace.equals(other.fTrace)) { return false; } if (!Objects.equals(fType, other.fType)) { return false; } return true; }
Source:
<code>public void indexed() { realm.beginTransaction(); MutableRealmIntegerTypes c1 = realm.createObject(MutableRealmIntegerTypes.class); realm.commitTransaction(); <START> Table table = realm.getTable(MutableRealmIntegerTypes.class); <END> assertTrue(table.hasSearchIndex(table.getColumnIndex(MutableRealmIntegerTypes.FIELD_INDEXED_MUTABLEREALMINTEGER))); assertFalse(table.hasSearchIndex(table.getColumnIndex(MutableRealmIntegerTypes.FIELD_NULLABLE_MUTABLEEALMINTEGER))); }</code><technical_language>ditto, hasIndex()</technical_language>

Target:
public void indexed() { realm.beginTransaction(); MutableRealmIntegerTypes c1 = realm.createObject(MutableRealmIntegerTypes.class); realm.commitTransaction(); assertTrue( realm.getSchema().get("MutableRealmIntegerTypes") .hasIndex(MutableRealmIntegerTypes.FIELD_INDEXED_MUTABLEREALMINTEGER)); assertFalse( realm.getSchema().get("MutableRealmIntegerTypes") .hasIndex(MutableRealmIntegerTypes.FIELD_NULLABLE_MUTABLEEALMINTEGER)); }