auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void applyStatefulStreamSerializationTest() { final ApplyStatefulOperatorStream statefulOpStream = new ApplyStatefulOperatorStream<>( expectedApplyStatefulFunction, mockDag); final Vertex serializedVertex = statefulOpStream.getSerializedVertex(); Assert.assertEquals(serializedVertex.getVertexType(), VertexTypeEnum.INSTANT_OPERATOR); final InstantOperatorInfo statefulOpInfo = (InstantOperatorInfo) serializedVertex.getAttributes(); <START> final List<ByteBuffer> statefulOpObjects = statefulOpInfo.getObjects(); <END> final ApplyStatefulFunction deserializedOpState = (ApplyStatefulFunction) deserializeObject(statefulOpObjects.get(0)); final Tuple2 firstInput = new Tuple2<>("ABC", 1); final Tuple2 secondInput = new Tuple2<>("BAC", 1); final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction1 = expectedApplyStatefulFunction; final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction2 = deserializedOpState; Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(firstInput); applyStatefulFunction2.update(firstInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(secondInput); applyStatefulFunction2.update(secondInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); }</code><technical_language>function</technical_language>

Target:
public void applyStatefulStreamSerializationTest() { final ApplyStatefulOperatorStream statefulOpStream = new ApplyStatefulOperatorStream<>( expectedApplyStatefulFunction, mockDag); final Vertex serializedVertex = statefulOpStream.getSerializedVertex(); Assert.assertEquals(serializedVertex.getVertexType(), VertexTypeEnum.INSTANT_OPERATOR); final InstantOperatorInfo statefulOpInfo = (InstantOperatorInfo) serializedVertex.getAttributes(); final List<ByteBuffer> statefulOpFunctions = statefulOpInfo.getFunctions(); final ApplyStatefulFunction deserializedOpState = (ApplyStatefulFunction) deserializeFunction(statefulOpFunctions.get(0)); final Tuple2 firstInput = new Tuple2<>("ABC", 1); final Tuple2 secondInput = new Tuple2<>("BAC", 1); final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction1 = expectedApplyStatefulFunction; final ApplyStatefulFunction<Tuple2<String, Integer>, Integer> applyStatefulFunction2 = deserializedOpState; Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(firstInput); applyStatefulFunction2.update(firstInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); applyStatefulFunction1.update(secondInput); applyStatefulFunction2.update(secondInput); Assert.assertEquals(applyStatefulFunction1.produceResult(), applyStatefulFunction2.produceResult()); }
Source:
<code><START> public void enqueue(E e) { <END> final Long id = guidGenerator.nextLong(); CorfuQueueRecord<E> queueEntry = new CorfuQueueRecord<E>(0, 0, id, e); class QueueEntryAddressGetter implements TransactionalContext.PreCommitListener { CorfuQueueRecord<E> queueRecord; QueueEntryAddressGetter(CorfuQueueRecord<E> queueRecord) { this.queueRecord = queueRecord; } @Override public void preCommitCallback(TokenResponse tokenResponse) { queueRecord.getRecordId().setEpoch(tokenResponse.getEpoch()); queueRecord.getRecordId().setSequence(tokenResponse.getSequence()); } } if (TransactionalContext.isInTransaction()) { QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(queueEntry); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); } corfuTable.put(queueEntry.getRecordId().getEntryId(), queueEntry); }</code><technical_language>update method java doc, returned value</technical_language>

Target:
public void enqueue(E e) { final Long id = guidGenerator.nextLong(); CorfuQueueRecord<E> queueEntry; if (TransactionalContext.isInTransaction()) { queueEntry = new CorfuQueueRecord<>(Address.NON_ADDRESS, Address.NON_ADDRESS, id, e); class QueueEntryAddressGetter implements PreCommitListener { private CorfuQueueRecord<E> queueRecord; private QueueEntryAddressGetter(CorfuQueueRecord<E> queueRecord) { this.queueRecord = queueRecord; } @Override public void preCommitCallback(TokenResponse tokenResponse) { queueRecord.getRecordId().setEpoch(tokenResponse.getEpoch()); queueRecord.getRecordId().setSequence(tokenResponse.getSequence()); log.trace("preCommitCallback for Queue: " + queueRecord.getRecordId().toString()); } } QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(queueEntry); log.trace("enqueue: Adding preCommitListener for Queue: " + queueEntry.getRecordId().toString()); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); } else { queueEntry = new CorfuQueueRecord<>(0, 0, id, e); } corfuTable.put(queueEntry.getRecordId().getEntryId(), queueEntry); }
Source:
<code>private void umountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { <START> localDir = "/var/cloud_mount/" + UUID.nameUUIDFromBytes(remoteDir.getBytes()); <END> } String result = callHostPlugin(conn, "cloud-plugin-storage", "umountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); if (org.apache.commons.lang.StringUtils.isBlank(result)) { String errMsg = "Could not umount secondary storage " + remoteDir + " on host " + localDir; s_logger.warn(errMsg); } }</code><technical_language>plase fatcor out hardocded path segment</technical_language>

Target:
private void umountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { localDir = BASE_MOUNT_POINT_ON_REMOTE + UUID.nameUUIDFromBytes(remoteDir.getBytes()); } String result = callHostPlugin(conn, "cloud-plugin-storage", "umountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); if (org.apache.commons.lang.StringUtils.isBlank(result)) { String errMsg = "Could not umount secondary storage " + remoteDir + " on host " + localDir; s_logger.warn(errMsg); } }
Source:
<code>private LinuxStyle(String label, int red, int green, int blue, int alpha, float heightFactor) { if (red > 255 || red < 0) { throw new IllegalArgumentException("Red needs to be between 0 and 255"); } if (green > 255 || green < 0) { throw new IllegalArgumentException("Green needs to be between 0 and 255"); } if (blue > 255 || blue < 0) { throw new IllegalArgumentException("Blue needs to be between 0 and 255"); } if (alpha > 255 || alpha < 0) { throw new IllegalArgumentException("alpha needs to be between 0 and 255"); } if (heightFactor > 1.0 || heightFactor < 0) { throw new IllegalArgumentException("Height factor needs to be between 0 and 1.0, given hint : " + heightFactor); } fMap = ImmutableMap.of(StyleProperties.STYLE_NAME, label, StyleProperties.BACKGROUND_COLOR, X11ColorUtils.toHexColor(red, green, blue), StyleProperties.HEIGHT, heightFactor, <START> StyleProperties.OPACITY, (float) alpha / 255); <END> }</code><technical_language>BaseDataProviderPresentationProvider, group name in legend is longer "Process States" ControlFlowPresentationProvider constructor. This replaced setting STYLE_GROUP property in this map for state. I set a STYLE_GROUP for link state</technical_language>

Target:
private LinuxStyle(String label, int red, int green, int blue, int alpha, float heightFactor) { this(label, red, green, blue, alpha, heightFactor, String.valueOf(Messages.LinuxStyles_ProcessGroup)); }
Source:
<code>public void shouldPlaceTokenWhenUrlHasFragment() { final String docUrl = "<LINK_2>"; <START> assertEquals("<LINK_0>", sendMail.createDocUrlWithToken(docUrl, TOKEN)); <END> }</code><technical_language>?token=ABC "?token=" + TOKEN. consistent</technical_language>

Target:
public void shouldPlaceTokenWhenUrlHasFragment() { final String docUrl = "<LINK_2>"; assertEquals("<LINK_1>"+TOKEN+"#/server", sendMail.createDocUrlWithToken(docUrl, TOKEN)); }
Source:
<code>public void testResponderSendOk() throws Exception { Responder spy = PowerMockito.spy(responder); Payload payload = new Payload.PayloadBuilder().build(); spy.send(payload, null); <START> PowerMockito.verifyPrivate(spy, times(1)).invoke("send", anyObject(), anyObject()); <END> }</code><technical_language>Is this a typo? "sendMessage"</technical_language>

Target:
public void testResponderSendOk() throws Exception { Responder spy = PowerMockito.spy(responder); Payload payload = new Payload.PayloadBuilder().build(); spy.send(payload, null); PowerMockito.verifyPrivate(spy, times(1)).invoke("sendMessage", anyObject(), anyObject()); }
Source:
<code>private HiveCompressionCodec getHiveCompressionCodec(ConnectorSession session, boolean isTemporaryTable, HiveStorageFormat storageFormat) { if (isTemporaryTable) { return getTemporaryTableCompressionCodec(session); } if (storageFormat.equals(ORC) || storageFormat.equals(DWRF)) { return getOrcCompressionCodec(session); } <START> return getCompressionCodec(session); <END> }</code><technical_language>"=="</technical_language>

Target:
private HiveCompressionCodec getHiveCompressionCodec(ConnectorSession session, boolean isTemporaryTable, HiveStorageFormat storageFormat) { if (isTemporaryTable) { return getTemporaryTableCompressionCodec(session); } if (storageFormat == ORC || storageFormat == DWRF) { return getOrcCompressionCodec(session); } return getCompressionCodec(session); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; State state = (State) o; <START> if (id != state.id) return false; <END> if (count != state.count) return false; return source != null ? source.equals(state.source) : state.source == null; }</code><technical_language>statements folded one: return (id == state.id) && (count == state.count) && ..</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; State state = (State) o; return id == state.id && count == state.count && (source != null ? source.equals(state.source) : state.source == null); }
Source:
<code>public void run(final Callback callback) { final Stack<Node<View, Edge>> nodes = new Stack<Node<View, Edge>>(); processedConnectors.clear(); childrenTraverseProcessor .setRootUUID(candidate.getUUID()) .traverse(graph, new AbstractChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>>() { @Override public void startNodeTraversal(final Node<View, Edge> node) { super.startNodeTraversal(node); nodes.add(node); } @Override public boolean startNodeTraversal(final List<Node<View, Edge>> parents, final Node<View, Edge> node) { super.startNodeTraversal(parents, node); nodes.add(node); return true; } }); <START> int nodesSize = nodes.size(); <END> while (nodesSize > 0) { processNode(nodes.get(nodesSize - 1), callback, false); nodesSize--; } processNode(candidate, callback, true); }</code><technical_language>ok fix is reverting collection order, keeping nodes.forEach instead changing type of collection for nodes? a Stack, changing a Queue, eg: ArrayDequeue? This need add logic for controlling iteration, collection's internal iterator forEach</technical_language>

Target:
public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = new ArrayDeque(); processedConnectors.clear(); childrenTraverseProcessor .setRootUUID(candidate.getUUID()) .traverse(graph, new AbstractChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>>() { @Override public void startNodeTraversal(final Node<View, Edge> node) { super.startNodeTraversal(node); nodes.add(node); } @Override public boolean startNodeTraversal(final List<Node<View, Edge>> parents, final Node<View, Edge> node) { super.startNodeTraversal(parents, node); nodes.add(node); return true; } }); nodes.descendingIterator().forEachRemaining(node -> processNode(node, callback, false)); processNode(candidate, callback, true); }
Source:
<code>public List<CountDataPoint> topCounts(String metricId, Interval interval, DateTime timestamp, long offset, long size) { final String key = getKey(metricId, interval, timestamp); Collection<TypedTuple<String>> data = zsetOps.reverseRangeWithScores(key, offset, offset + size - 1); List<CountDataPoint> results = new ArrayList<CountDataPoint>(); for (TypedTuple<String> tuple : data) { results.add(new CountDataPoint( nameIdDao.getName(tuple.getValue()), tuple.getScore().longValue())); } return results; <START> } <END></code><technical_language>Collections.unmodifiableList(results);</technical_language>

Target:
public List<CountDataPoint> topCounts(String metricId, Interval interval, DateTime timestamp, long offset, long size) { final String key = getKey(metricId, interval, timestamp); Collection<TypedTuple<String>> data = zsetOps.reverseRangeWithScores(key, offset, offset + size - 1); List<CountDataPoint> results = new ArrayList<CountDataPoint>(); for (TypedTuple<String> tuple : data) { results.add(new CountDataPoint( nameIdDao.getName(tuple.getValue()), tuple.getScore().longValue())); } return Collections.unmodifiableList(results); }
Source:
<code>private void doRequestAndCheckAssertions(Map<String, Duration> flags, List<Map<String, Object>> assertions, HttpAssertionTarget target, final String url) { switch (target) { case body: <START> Supplier<String> getBody = new Supplier<String>() { <END> @Override public String get() { return HttpTool.getContent(url); } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getBody); break; case status: Supplier<Integer> getStatusCode = new Supplier<Integer>() { @Override public Integer get() { try { return HttpTool.getHttpStatusCode(url); } catch (Exception e) { LOG.error("HTTP call to failed due to ... returning Status code [500]", url, e.getMessage()); return HttpStatus.SC_INTERNAL_SERVER_ERROR; } } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getStatusCode); break; default: throw new RuntimeException("Unexpected assertion target (" + target + ")"); } }</code><technical_language>for checks this this (anonymous class) is do (just FYI). if need this in more places create a ResourceUtils.getResourceAsStringSupplier() do this. btw ResourceUtils for reading URL's classpath URL's context aware. important in this case FYI</technical_language>

Target:
private void doRequestAndCheckAssertions(Map<String, Duration> flags, List<Map<String, Object>> assertions, HttpAssertionTarget target, final String url) { switch (target) { case body: Supplier<String> getBody = new Supplier<String>() { @Override public String get() { return HttpTool.getContent(url); } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getBody); break; case status: Supplier<Integer> getStatusCode = new Supplier<Integer>() { @Override public Integer get() { try { return HttpTool.getHttpStatusCode(url); } catch (Exception e) { LOG.info("HTTP call to failed due to [{}]", url, e.getMessage()); throw Exceptions.propagate(e); } } }; TestFrameworkAssertions.checkAssertions(flags, assertions, target.toString(), getStatusCode); break; default: throw new RuntimeException("Unexpected assertion target (" + target + ")"); } }
Source:
<code>public void registerFeedback(ConjureTimeLockClientFeedback feedback) { <START> trackedFeedbackReports.put(feedback.hashCode(), feedback); <END> }</code><technical_language>nit: suggest a UUID avoid collisions - hashCode 32 bits of entropy</technical_language>

Target:
public void registerFeedback(ConjureTimeLockClientFeedback feedback) { trackedFeedbackReports.put(UUID.randomUUID(), feedback); }
Source:
<code>public QueryBuilder make(EsHint hint, String fieldName, Object value) { String valueString = (String) value; if (valueString.endsWith("*") && valueString.length() > 2) { value = valueString.substring(0, valueString.length() - 1); } MatchPhrasePrefixQueryBuilder matchPhrasePrefixQuery = QueryBuilders.matchPhrasePrefixQuery(fieldName, value); if (hint.analyzer != null) { <START> matchPhrasePrefixQuery.analyzer(hint.analyzer); <END> } return matchPhrasePrefixQuery; }</code><technical_language>need for null check</technical_language>

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String valueString = (String) value; if (valueString.endsWith("*") && valueString.length() > 2) { value = valueString.substring(0, valueString.length() - 1); } return QueryBuilders.matchPhrasePrefixQuery(fieldName, value).analyzer(hint.analyzer); }
Source:
<code><START> private static void verifyProductsOutput(Collection<Product> originalProducts, <END> Set<ProductDTO> dtoProducts) { for (Product productSource : originalProducts) { for (ProductDTO productDTO : dtoProducts) { assertNotNull(productDTO); assertNotNull(productDTO.getId()); if (productDTO.getId().equals(productSource.getId())) { assertTrue(productDTO.getName().equals(productSource.getName())); } } } }</code><technical_language>is this function static</technical_language>

Target:
private void verifyProductsOutput(Collection<Product> originalProducts, Set<ProductDTO> dtoProducts) { for (Product productSource : originalProducts) { for (ProductDTO productDTO : dtoProducts) { assertNotNull(productDTO); assertNotNull(productDTO.getId()); if (productDTO.getId().equals(productSource.getId())) { assertTrue(productDTO.getName().equals(productSource.getName())); } } } }
Source:
<code>public PreviewSnapshotModel(VM vm, Guid userSelectedSnapshotId) { this(); <START> this.vm = <END> vm; setVmId(vm.getId()); this.userSelectedSnapshotId = userSelectedSnapshotId; }</code><technical_language>This field is written read, removed (Findbugs)</technical_language>

Target:
public PreviewSnapshotModel(VM vm, Guid userSelectedSnapshotId) { this(); setVmId(vm.getId()); }
Source:
<code>public boolean validateConcurStandardAccountExtractFile(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { boolean valid = validateDetailCount(concurStandardAccountingExtractFile); <START> valid = validateAmounts(concurStandardAccountingExtractFile) && valid; <END> valid = validateDate(concurStandardAccountingExtractFile.getBatchDate()) && valid; if (LOG.isDebugEnabled() && valid) { LOG.debug("validateConcurStandardAccountExtractFile, passed file level validation, the record counts, batch date, and journal totals are all correct."); } return valid; }</code><technical_language>this valid &=</technical_language>

Target:
public boolean validateConcurStandardAccountExtractFile(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { boolean valid = validateDetailCount(concurStandardAccountingExtractFile); valid = validateAmountsAndDebitCreditCode(concurStandardAccountingExtractFile) && valid; valid = validateDate(concurStandardAccountingExtractFile.getBatchDate()) && valid; if (LOG.isDebugEnabled() && valid) { LOG.debug("validateConcurStandardAccountExtractFile, passed file level validation, the record counts, batch date, and journal totals are all correct."); } return valid; }
Source:
<code>private void initializeFields() { for (Iterator i = fields().values().iterator(); i.hasNext();) { StructField f = (StructField) i.next(); <START> try { <END> Object o = f.field.get(this); if (o == null) { initializeField(f, f.type); } } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } }</code><technical_language>Structure.getField(StructField) instead of f.field.get(this); exception handling already</technical_language>

Target:
private void initializeFields() { for (Iterator i = fields().values().iterator(); i.hasNext();) { StructField f = (StructField) i.next(); Object o = this.getField(f); if (o == null) { initializeField(f, f.type); } } }
Source:
<code><START> private void setCorrelationId(HasCorrelationId params) { <END> params.setCorrelationId(getCurrent().getCorrelationId()); }</code><technical_language>correlation id parameters, considered optional: Strign correlationId = getCurrent().getParameters().get(CORRELATION_ID); if (correlationId != null) { params.setCorrelationId(correlationId); }</technical_language>

Target:
private void setCorrelationId(HasCorrelationId params) { String correlationId = getCurrent().getParameters().get(CORRELATION_ID); if (correlationId != null) { params.setCorrelationId(correlationId); } }
Source:
<code>private static String formatDoubleAsDataSize(double value) { if (isFinite(value)) { return DataSize.succinctDataSize(value, BYTE).toString(); } return "?"; <START> <END> }</code><technical_language>blank</technical_language>

Target:
private static String formatDoubleAsDataSize(double value) { if (!isFinite(value)) { return Double.toString(value); } else if (isNaN(value)) { return "?"; } return DataSize.succinctDataSize(value, BYTE).toString(); }
Source:
<code>private void addFacetingRequest(JsonBuilder.Object facets, FacetingRequest facetingRequest) { String facetFieldAbsoluteName = facetingRequest.getFieldName(); FacetMetadata facetMetadata = null; for ( Class<?> entityType : getQueriedEntityTypes() ) { EntityIndexBinding binding = extendedIntegrator.getIndexBinding( entityType ); TypeMetadata typeMetadata = binding.getDocumentBuilder().getTypeMetadata(); facetMetadata = typeMetadata.getFacetMetadataFor( facetFieldAbsoluteName ); if ( facetMetadata != null ) { break; } } if ( facetMetadata == null ) { <START> throw new AssertionFailure( "Unknown facet field name:" + facetFieldAbsoluteName ); <END> } String sourceFieldName = facetMetadata.getSourceField().getAbsoluteName(); String facetSubfieldName = facetMetadata.getRelativeName(); ToElasticsearch.addFacetingRequest( facets, facetingRequest, sourceFieldName, facetSubfieldName ); }</code><technical_language>path arrive user get this error? If can, move this logger</technical_language>

Target:
private void addFacetingRequest(JsonBuilder.Object facets, FacetingRequest facetingRequest) { String facetFieldAbsoluteName = facetingRequest.getFieldName(); FacetMetadata facetMetadata = null; for ( Class<?> entityType : getQueriedEntityTypes() ) { EntityIndexBinding binding = extendedIntegrator.getIndexBinding( entityType ); TypeMetadata typeMetadata = binding.getDocumentBuilder().getTypeMetadata(); facetMetadata = typeMetadata.getFacetMetadataFor( facetFieldAbsoluteName ); if ( facetMetadata != null ) { break; } } if ( facetMetadata == null ) { throw LOG.unknownFieldNameForFaceting( facetingRequest.getFacetingName(), facetingRequest.getFieldName() ); } String sourceFieldAbsoluteName = facetMetadata.getSourceField().getAbsoluteName(); String facetSubfieldName = facetMetadata.getPath().getRelativeName(); ToElasticsearch.addFacetingRequest( facets, facetingRequest, sourceFieldAbsoluteName, facetSubfieldName ); }
Source:
<code>private static boolean objectToString(StringBuilder bld, ObjectNode node, int depth, boolean newLine) { if (newLine) { indent(bld, depth); newLine = false; } <START> if (node.size() > 0 || (node.size() == 0 && node instanceof ObjectNode)) { <END> bld.append("{\n"); newLine = true; } boolean first = true; for (Iterator<Map.Entry<String, JsonNode>> itr = node.fields(); itr.hasNext();) { if (first) { first = false; } else { if (newLine) { indent(bld, depth); } bld.append(','); bld.append('\n'); } Map.Entry<String, JsonNode> entry = itr.next(); indent(bld, depth); bld.append('\"'); bld.append(entry.getKey()); bld.append('\"'); bld.append(':'); newLine = toString(bld, entry.getValue(), depth + 1, false); if (newLine) { indent(bld, depth); newLine = false; } } if (node.size() > 0) { bld.append('\n'); newLine = true; } if (newLine) { indent(bld, depth); } bld.append('}'); return false; }</code><technical_language>node _is_ ObjectNode based arguments objectToString, is this checked</technical_language>

Target:
private static boolean objectToString(StringBuilder bld, ObjectNode node, int depth, boolean newLine) { if (newLine) { indent(bld, depth); newLine = false; } if (node.size() >= 0){ bld.append("{\n"); newLine = true; } boolean first = true; for (Iterator<Map.Entry<String, JsonNode>> itr = node.fields(); itr.hasNext();) { if (first) { first = false; } else { if (newLine) { indent(bld, depth); } bld.append(','); bld.append('\n'); } Map.Entry<String, JsonNode> entry = itr.next(); indent(bld, depth); bld.append('\"'); bld.append(entry.getKey()); bld.append('\"'); bld.append(':'); newLine = toString(bld, entry.getValue(), depth + 1, false); if (newLine) { indent(bld, depth); newLine = false; } } if (node.size() > 0) { bld.append('\n'); newLine = true; } if (newLine) { indent(bld, depth); } bld.append('}'); return false; }
Source:
<code><START> public static String getPropertyValue(Property[] properties, String propertyName) { <END> if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) { return null; } for (Property property : properties) { if (property == null || StringUtils.isBlank(property.getName())) { continue; } if (property.getName().equals(propertyName)) { if (StringUtils.isNotBlank(property.getValue())){ return property.getValue(); } } } return null; }</code><technical_language>is a method called getProperty() in class. need do getValue that. need a new method for that. do improvements in this method method itself</technical_language>

Target:
public static String getPropertyValue(Property[] properties, String propertyName) { Property property = getProperty(properties, propertyName); if (property != null) { if (StringUtils.isNotBlank(property.getValue())) { return property.getValue(); } } return null; }
Source:
<code>public static Object encodeObject(Object dataToEncode) { Object returnValue = dataToEncode; if (dataToEncode instanceof byte[]) { returnValue = SafeEncoder.encode((byte[]) dataToEncode); <START> } else if (dataToEncode instanceof ArrayList) { ArrayList arrayToDecode = (ArrayList)dataToEncode; ArrayList returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); } <END> returnValue = returnValueArray; } return returnValue; }</code><technical_language>I replace ArrayList List. if (dataToEncode instanceof List) { List arrayToDecode = (List)dataToEncode; List returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); }</technical_language>

Target:
public static Object encodeObject(Object dataToEncode) { if (dataToEncode instanceof byte[]) { return SafeEncoder.encode((byte[]) dataToEncode); } if (dataToEncode instanceof List) { List arrayToDecode = (List)dataToEncode; List returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); } return returnValueArray; } return dataToEncode; }
Source:
<code>public static Iterable<Object[]> data() { return Arrays.asList(new Object[][] { {"SetVariableBrick", new SetVariableBrick()}, {"ChangeVariableBrick", new ChangeVariableBrick()}, {"AskBrick", new AskBrick()}, {"AskSpeechBrick", new AskSpeechBrick()}, {"HideTextBrick", new HideTextBrick()}, {"ShowTextBrick", new ShowTextBrick()}, {"ShowTextColorSizeAlignmentBrick", new ShowTextColorSizeAlignmentBrick()}, {"ReadVariableFromDeviceBrick", new ReadVariableFromDeviceBrick()}, <START> {"WebRequestBrick", new WebRequestBrick()}, <END> {"WriteVariableOnDeviceBrick", new WriteVariableOnDeviceBrick()}, }); }</code><technical_language>This change is necessary is faulty. Altogether code nice! Eventually, squash commits, please undo this change</technical_language>

Target:
public static Iterable<Object[]> data() { return Arrays.asList(new Object[][] { {"SetVariableBrick", new SetVariableBrick()}, {"ChangeVariableBrick", new ChangeVariableBrick()}, {"AskBrick", new AskBrick()}, {"AskSpeechBrick", new AskSpeechBrick()}, {"HideTextBrick", new HideTextBrick()}, {"ShowTextBrick", new ShowTextBrick()}, {"ShowTextColorSizeAlignmentBrick", new ShowTextColorSizeAlignmentBrick()}, {"WebRequestBrick", new WebRequestBrick()}, {"ReadVariableFromDeviceBrick", new ReadVariableFromDeviceBrick()}, {"WriteVariableOnDeviceBrick", new WriteVariableOnDeviceBrick()}, }); }
Source:
<code>protected void executeQueryCommand() { try { getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); } catch (Exception e) { <START> log.error("Failed to retrieve image list: {}", e.getCause().getMessage()); <END> getQueryReturnValue().setExceptionString(e.getCause().getMessage()); getQueryReturnValue().setSucceeded(false); } }</code><technical_language>e.getCause() null, causing NPE. please e.printStackTrace()</technical_language>

Target:
protected void executeQueryCommand() { try { getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList()); } catch (Exception e) { String message = Optional.of(e.getCause()).map(Throwable::getMessage).orElse(""); log.error("Failed to retrieve image list: {}", message); getQueryReturnValue().setExceptionString(message); getQueryReturnValue().setSucceeded(false); } }
Source:
<code><START> default Attributes getAttributes() throws RealmUnavailableException { <END> throw log.attributesNotSupportedByRealm(); }</code><technical_language>+1 this</technical_language>

Target:
default Attributes getAttributes() throws RealmUnavailableException { return null; }
Source:
<code>public void destroy() { executor.shutdownNow(); try { executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { <START> LOG.warn("Destroying InMemoryRegistrationStore was interrupted.", e); <END> } }</code><technical_language>Bad copy/paste: InMemoryRegistrationStore</technical_language>

Target:
public void destroy() { executor.shutdownNow(); try { executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.warn("Destroying RequestSender was interrupted.", e); } }
Source:
<code><START> public double getLatitude() { <END> return mLatitude; }</code><technical_language>Please getters final</technical_language>

Target:
public final double getLatitude() { return mLatitude; }
Source:
<code>public String toString() { <START> return value+""; <END> }</code><technical_language>Neater: String.valueOf(value);</technical_language>

Target:
public String toString() { return String.valueOf(value); }
Source:
<code>private void flushRegions() throws ForeignException { if (regions.isEmpty()) { return; } monitor.rethrowException(); if (taskManager.hasTasks()) { throw new IllegalStateException("Attempting to flush " + table + " but we currently have outstanding tasks"); } List<byte[]> families = null; if (family != null) { <START> LOG.debug("Flush regions with specified family:{}", family); <END> families = Arrays.asList(Bytes.toBytes(family)); } for (HRegion region : regions) { taskManager.submitTask(new RegionFlushTask(region, families)); monitor.rethrowException(); } LOG.debug("Flush region tasks submitted for " + regions.size() + " regions"); try { taskManager.waitForOutstandingTasks(); } catch (InterruptedException e) { throw new ForeignException(getMemberName(), e); } }</code><technical_language>Nit: more specific debugging: "About flush family regions for table {}"</technical_language>

Target:
private void flushRegions() throws ForeignException { if (regions.isEmpty()) { return; } monitor.rethrowException(); if (taskManager.hasTasks()) { throw new IllegalStateException("Attempting to flush " + table + " but we currently have outstanding tasks"); } List<byte[]> families = null; if (family != null) { LOG.debug("About to flush family on all regions for table {}", family, table); families = Arrays.asList(Bytes.toBytes(family)); } for (HRegion region : regions) { taskManager.submitTask(new RegionFlushTask(region, families)); monitor.rethrowException(); } LOG.debug("Flush region tasks submitted for " + regions.size() + " regions"); try { taskManager.waitForOutstandingTasks(); } catch (InterruptedException e) { throw new ForeignException(getMemberName(), e); } }
Source:
<code>public List<HRegionInfo> getTableRegions(TableName tableName) throws IOException { List<HRegionInfo> regionInfos = Collections.emptyList(); <START> BigtableRegionLocator regionLocator = new BigtableRegionLocator(tableName, options, connection.getSession().getDataClient()); <END> for (HRegionLocation location : regionLocator.getAllRegionLocations()) { regionInfos.add(location.getRegionInfo()); } regionLocator.close(); return regionInfos; }</code><technical_language>please add a CommonConnection.getAllRegionInfos(TableName) method instead</technical_language>

Target:
public List<HRegionInfo> getTableRegions(TableName tableName) throws IOException { return connection.getAllRegionInfos(tableName); }
Source:
<code>private int getFrameLength(final SendableApnsPushNotification<T> sendableApnsPushNotification) { return ApnsFrameItem.values().length * (FRAME_ITEM_ID_SIZE + FRAME_ITEM_LENGTH_SIZE) + sendableApnsPushNotification.getPushNotification().getToken().length + sendableApnsPushNotification.getPushNotification().getPayload().getBytes(utf8).length + SEQUENCE_NUMBER_SIZE + EXPIRATION_SIZE + <START> PRIORITY_SIZE; <END> }</code><technical_language>this give wrong length if priority</technical_language>

Target:
private int getFrameLength(final SendableApnsPushNotification<T> sendableApnsPushNotification) { return ApnsFrameItem.values().length * (FRAME_ITEM_ID_SIZE + FRAME_ITEM_LENGTH_SIZE) + sendableApnsPushNotification.getPushNotification().getToken().length + sendableApnsPushNotification.getPushNotification().getPayload().getBytes(utf8).length + SEQUENCE_NUMBER_SIZE + DELIVERY_INVALIDATION_TIME_SIZE + PRIORITY_SIZE; }
Source:
<code>protected void executeCommand() { <START> userProfileDao.remove(getParameters().getUserProfile().getId()); <END> }</code><technical_language>need set succeeded true</technical_language>

Target:
protected void executeCommand() { userProfileDao.remove(getParameters().getUserProfile().getId()); setSucceeded(true); }
Source:
<code>public void loadRecord(ObjectNode record) { String uri = directory+UUID.randomUUID().toString()+".json"; count++; record.set("instance", this.recordDef); <START> record.set("metadata", this.recordMetadata); <END> JacksonHandle handle = new JacksonHandle(record); JSONWriteOperation operation = new JSONWriteOperation(uri, documentMetadata, handle); batcher.add(operation); }</code><technical_language>create a new ObjectNode line 39 set "instance" property of new object node record "metadata" property of new object node recordMetadata. way, new ObjectNode a wrapper for record converted a CSV row metadata provided job</technical_language>

Target:
public void loadRecord(ObjectNode record) { String uri = directory+UUID.randomUUID().toString()+".json"; count++; ObjectNode recordData = JsonNodeFactory.instance.objectNode(); recordData.set("metadata", this.recordMetadata); recordData.set("instance", record); JacksonHandle handle = new JacksonHandle(recordData); JSONWriteOperation operation = new JSONWriteOperation(uri, documentMetadata, handle); batcher.add(operation); }
Source:
<code>public String getQueryId() { List<String> content = new ArrayList<>(); if (this.entrezGeneId != null) { content.add(Integer.toString(this.entrezGeneId)); } else { if (this.hugoSymbol != null) { content.add(this.hugoSymbol); } else { content.add(""); } } if (this.alteration != null) { content.add(this.alteration); } else { content.add(""); } <START> if (this.alteration != null) { <END> content.add(this.alteration); } else { content.add(""); } if (this.alterationType != null) { content.add(this.alterationType); } else { content.add(""); } if (this.type != null) { content.add(this.type); } else { content.add(""); } if (this.tumorType != null) { content.add(this.tumorType); } else { content.add(""); } if (consequence != null) { content.add(this.consequence); } else { content.add(""); } if (this.proteinStart != null) { content.add(Integer.toString(this.proteinStart)); } else { content.add(""); } if (this.proteinEnd != null) { content.add(Integer.toString(this.proteinEnd)); } else { content.add(""); } return StringUtils.join(content.toArray(), "&"); }</code><technical_language>code duplication</technical_language>

Target:
public String getQueryId() { List<String> content = new ArrayList<>(); if (this.entrezGeneId != null) { content.add(Integer.toString(this.entrezGeneId)); } else { if (this.hugoSymbol != null) { content.add(this.hugoSymbol); } else { content.add(""); } } if (this.alteration != null) { content.add(this.alteration); } else { content.add(""); } if (this.alterationType != null) { content.add(this.alterationType); } else { content.add(""); } if (this.type != null) { content.add(this.type); } else { content.add(""); } if (this.tumorType != null) { content.add(this.tumorType); } else { content.add(""); } if (consequence != null) { content.add(this.consequence); } else { content.add(""); } if (this.proteinStart != null) { content.add(Integer.toString(this.proteinStart)); } else { content.add(""); } if (this.proteinEnd != null) { content.add(Integer.toString(this.proteinEnd)); } else { content.add(""); } return StringUtils.join(content.toArray(), "&"); }
Source:
<code>public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); Document document = MessageUtil.getDocumentBody(in); try { String actionType = document.getRootElement().getChild("title", ATOM_NS).getTextTrim(); in.setHeader(CdrSolrUpdateAction, actionType); in.setBody(document); <START> } catch (NullPointerException e) { <END> in.setHeader(CdrSolrUpdateAction, "none"); } }</code><technical_language>test actionType in if-block null, catching NPE</technical_language>

Target:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); Document document = MessageUtil.getDocumentBody(in); if (document == null) { return; } String actionType = document.getRootElement().getChildTextTrim("title", ATOM_NS); if (actionType == null) { in.setHeader(CdrSolrUpdateAction, null); return; } in.setHeader(CdrSolrUpdateAction, actionType); in.setBody(document); }
Source:
<code>private void update() { if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) { return; } DataHandle handle = model.getInputConfig().getInput().getHandle(); root.setRedraw(false); for (TableItem item : features.getItems()) { item.dispose(); } for (TableItem item : classes.getItems()) { item.dispose(); } for (int col = 0; col < handle.getNumColumns(); col++) { String attribute = handle.getAttributeName(col); Image image = controller.getResources().getImage(model.getInputDefinition().getAttributeType(attribute)); createTableItem(attribute, image, features, model.getSelectedFeatures()); <START> createTableItem(attribute, image, classes, model.getSelectedClasses()); <END> } root.setRedraw(true); SWTUtil.enable(root); }</code><technical_language>I is necessary show image in tables. I suggest display in left table left side</technical_language>

Target:
private void update() { if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) { return; } DataHandle handle = model.getInputConfig().getInput().getHandle(); root.setRedraw(false); for (TableItem item : features.getItems()) { item.dispose(); } for (TableItem item : classes.getItems()) { item.dispose(); } for (int col = 0; col < handle.getNumColumns(); col++) { String attribute = handle.getAttributeName(col); DataDefinition def = model.getOutputDefinition() == null ? model.getInputDefinition() : model.getOutputDefinition(); Image image = controller.getResources().getImage(def.getAttributeType(attribute)); TableItem itemF = new TableItem(features, SWT.NONE); itemF.setText(new String[] { "", attribute } ); itemF.setImage(0, image); itemF.setChecked(model.getSelectedFeatures().contains(attribute)); TableItem itemC = new TableItem(classes, SWT.NONE); itemC.setText(attribute); itemC.setChecked(model.getSelectedClasses().contains(attribute)); } root.setRedraw(true); SWTUtil.enable(root); }
Source:
<code>public void testGroupLayerWithNotQueryableLayers() throws Exception { Catalog catalog = getCatalog(); CatalogFactory factory = catalog.getFactory(); WorkspaceInfo workspace = catalog.getWorkspaceByName(MockData.CITE_PREFIX); String groupLayer = "glqueryable"; <START> LayerInfo buildingsLayer = ModificationProxy.unwrap(catalog.getLayerByName(getLayerId(MockData.BUILDINGS))); <END> LayerInfo bridgesLayer = ModificationProxy.unwrap(catalog.getLayerByName(getLayerId(MockData.BRIDGES))); LayerInfo forestLayer = ModificationProxy.unwrap(catalog.getLayerByName(getLayerId(MockData.FORESTS))); buildingsLayer.setQueryable(false); bridgesLayer.setQueryable(false); forestLayer.setQueryable(true); LayerGroupInfo layerGroup = factory.createLayerGroup(); layerGroup.setName(groupLayer); layerGroup.setWorkspace(workspace); layerGroup.getLayers().add(buildingsLayer); layerGroup.getLayers().add(bridgesLayer); layerGroup.getLayers().add(forestLayer); new CatalogBuilder(catalog).calculateLayerGroupBounds(layerGroup); catalog.add(layerGroup); String name = MockData.CITE_PREFIX+":"+groupLayer; String request = "wms?bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg" + "&info_format=text/plain&request=GetFeatureInfo&layers=" + name + "&query_layers=" + name + "&width=20&height=20&x=10&y=10"; String result = getAsString(request); assertNotNull(result); assertTrue(result.indexOf("Green Forest") > 0); buildingsLayer.setQueryable(true); bridgesLayer.setQueryable(true); catalog.remove(layerGroup); }</code><technical_language>Proxy unwrapping happen in client code. done</technical_language>

Target:
public void testGroupLayerWithNotQueryableLayers() throws Exception { Catalog catalog = getCatalog(); CatalogFactory factory = catalog.getFactory(); WorkspaceInfo workspace = catalog.getWorkspaceByName(MockData.CITE_PREFIX); String groupLayer = "glqueryable"; LayerInfo buildingsLayer = catalog.getLayerByName(getLayerId(MockData.BUILDINGS)); buildingsLayer.setQueryable(false); catalog.save(buildingsLayer); LayerInfo bridgesLayer = catalog.getLayerByName(getLayerId(MockData.BRIDGES)); bridgesLayer.setQueryable(false); catalog.save(bridgesLayer); LayerInfo forestLayer = catalog.getLayerByName(getLayerId(MockData.FORESTS)); forestLayer.setQueryable(true); catalog.save(forestLayer); LayerGroupInfo layerGroup = factory.createLayerGroup(); layerGroup.setName(groupLayer); layerGroup.setWorkspace(workspace); layerGroup.getLayers().add(buildingsLayer); layerGroup.getLayers().add(bridgesLayer); layerGroup.getLayers().add(forestLayer); new CatalogBuilder(catalog).calculateLayerGroupBounds(layerGroup); catalog.add(layerGroup); String name = MockData.CITE_PREFIX+":"+groupLayer; String request = "wms?bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg" + "&info_format=text/plain&request=GetFeatureInfo&layers=" + name + "&query_layers=" + name + "&width=20&height=20&x=10&y=10"; String result = getAsString(request); assertNotNull(result); assertTrue(result.indexOf("Green Forest") > 0); buildingsLayer.setQueryable(true); catalog.save(buildingsLayer); bridgesLayer.setQueryable(true); catalog.save(bridgesLayer); catalog.remove(layerGroup); }
Source:
<code>public void onDeleteMembers(Id me, Collection<AccountGroupMember> toBeRemoved) throws IOException { try { List<AccountGroupMemberAudit> auditUpdates = Lists.newLinkedList(); List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); ReviewDb reviewDB = db.get(); for (final AccountGroupMember m : toBeRemoved) { AccountGroupMemberAudit audit = null; for (AccountGroupMemberAudit a : reviewDB.accountGroupMembersAudit() .byGroupAccount(m.getAccountGroupId(), m.getAccountId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me, TimeUtil.nowTs()); auditUpdates.add(audit); } else { audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); audit.removedLegacy(); auditInserts.add(audit); } } <START> reviewDB.accountGroupMembersAudit().update(auditUpdates); reviewDB.accountGroupMembersAudit().insert(auditInserts); <END> } catch (OrmException e) { throw new IOException("Cannot log delete group member event", e); } }</code><technical_language>Is this differentiation needed? done in upsert operation? reviewDB.accountGroupMembersAudit().upsert(auditUpdatesAndAuditInserts);</technical_language>

Target:
public void onDeleteMembers(Id me, Collection<AccountGroupMember> toBeRemoved) throws IOException { try { List<AccountGroupMemberAudit> auditUpdates = Lists.newLinkedList(); List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); ReviewDb reviewDB = db.get(); for (AccountGroupMember m : toBeRemoved) { AccountGroupMemberAudit audit = null; for (AccountGroupMemberAudit a : reviewDB.accountGroupMembersAudit() .byGroupAccount(m.getAccountGroupId(), m.getAccountId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me, TimeUtil.nowTs()); auditUpdates.add(audit); } else { audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); audit.removedLegacy(); auditInserts.add(audit); } } reviewDB.accountGroupMembersAudit().update(auditUpdates); reviewDB.accountGroupMembersAudit().insert(auditInserts); } catch (OrmException e) { throw new IOException("Cannot log delete group member event", e); } }
Source:
<code>public void createCacheStorageTest() { <START> CacheStorageImpl cache = new CacheStorageImpl(); <END> final Map<Identifier, OperatorState> queryState1= new HashMap<>(); final Map<Identifier, OperatorState> queryState2= new HashMap<>(); queryState1.put(oid1, value1); queryState2.put(oid1, value2); Assert.assertEquals(true, cache.create(qid1, queryState1)); Assert.assertEquals(false, cache.create(qid1, queryState2)); Assert.assertEquals(true, cache.create(qid2, queryState1)); }</code><technical_language>final</technical_language>

Target:
public void createCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); final Map<Identifier, OperatorState> queryState2 = new HashMap<>(); queryState1.put(oid1, value1); queryState2.put(oid1, value2); Assert.assertTrue(cache.create(qid1, queryState1)); Assert.assertFalse(cache.create(qid1, queryState2)); Assert.assertTrue(cache.create(qid2, queryState1)); }
Source:
<code>private Element timeZone() { <START> return textElement(BlogConstants.TIMEZONE, entity.getTimeZone()); <END> }</code><technical_language>import static</technical_language>

Target:
private Element timeZone() { return textElement(TIMEZONE, entity.getTimeZone()); }
Source:
<code><START> public boolean addDependencies(List<DynamicPomDependency> deps, <END> Path pomPath) { if (deps.isEmpty()) { return false; } try { org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Set keys = getKeysFromDeps(model.getDependencies()); for (DynamicPomDependency dep : deps) { Dependency pomDep = getMavenDependency(dep); if (!keys.contains(getKeyFromDep(dep))) { model.getDependencies().add(pomDep); } } writePOMModelOnFS(filePath, model); } catch (Exception ex) { logger.error(ex.getMessage(), ex); return false; } return true; }</code><technical_language>I do this method tested</technical_language>

Target:
public boolean addDependencies(List<DynamicPomDependency> deps, Path pomPath) { if (deps.isEmpty()) { return false; } boolean result = false; try { org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Map<String, String> keys = getKeysFromDeps(model.getDependencies()); for (DynamicPomDependency dep : deps) { String keyDep = getKeyFromDep(dep); if (!keys.containsKey(keyDep)) { Dependency pomDep = getMavenDependency(dep); model.getDependencies().add(pomDep); result = true; } else { List<Dependency> modelDeps = model.getDependencies(); for (Dependency modelDep : modelDeps) { if (modelDep.getGroupId().equals(dep.getGroupID()) && modelDep.getArtifactId().equals(dep.getArtifactID()) && !modelDep.getVersion().equals(dep.getVersion())) { modelDep.setVersion(dep.getVersion()); result = true; } } } } if (result) { writePOMModelOnFS(filePath, model); } } catch (Exception ex) { logger.error(ex.getMessage(), ex); result = false; } return result; }