yijunyu/c-to-rust huggingface dataset:
// Original:
public ProvisionByoipCidrResult provisionByoipCidr(ProvisionByoipCidrRequest request) {request = beforeClientExecution(request);return executeProvisionByoipCidr(request);}

// Translation:
public virtual ProvisionByoipCidrResponse ProvisionByoipCidr(ProvisionByoipCidrRequest request){var options = new InvokeOptions();options.RequestMarshaller = ProvisionByoipCidrRequestMarshaller.Instance;options.ResponseUnmarshaller = ProvisionByoipCidrResponseUnmarshaller.Instance;return Invoke<ProvisionByoipCidrResponse>(request, options);}
// Original:
public BatchGetApplicationRevisionsResult batchGetApplicationRevisions(BatchGetApplicationRevisionsRequest request) {request = beforeClientExecution(request);return executeBatchGetApplicationRevisions(request);}

// Translation:
public virtual BatchGetApplicationRevisionsResponse BatchGetApplicationRevisions(BatchGetApplicationRevisionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = BatchGetApplicationRevisionsRequestMarshaller.Instance;options.ResponseUnmarshaller = BatchGetApplicationRevisionsResponseUnmarshaller.Instance;return Invoke<BatchGetApplicationRevisionsResponse>(request, options);}
// Original:
public void expandRow(int rowNumber) {if (rowNumber == -1)return;if (!isRowGroupCollapsed(rowNumber)) {return;}int startIdx = findStartOfRowOutlineGroup(rowNumber);RowRecord row = getRow(startIdx);int endIdx = findEndOfRowOutlineGroup(rowNumber);if (!isRowGroupHiddenByParent(rowNumber)) {for (int i = startIdx; i <= endIdx; i++) {RowRecord otherRow = getRow(i);if (row.getOutlineLevel() == otherRow.getOutlineLevel() || !isRowGroupCollapsed(i)) {otherRow.setZeroHeight(false);}}}getRow(endIdx + 1).setColapsed(false);}

// Translation:
public void ExpandRow(int rowNumber){int idx = rowNumber;if (idx == -1)return;if (!IsRowGroupCollapsed(idx))return;int startIdx = FindStartOfRowOutlineGroup(idx);RowRecord row = GetRow(startIdx);int endIdx = FindEndOfRowOutlineGroup(idx);if (!IsRowGroupHiddenByParent(idx)){for (int i = startIdx; i <= endIdx; i++){if (row.OutlineLevel == GetRow(i).OutlineLevel)GetRow(i).ZeroHeight = (false);else if (!IsRowGroupCollapsed(i))GetRow(i).ZeroHeight = (false);}}GetRow(endIdx + 1).Colapsed = (false);}
// Original:
public GetSendQuotaResult getSendQuota(GetSendQuotaRequest request) {request = beforeClientExecution(request);return executeGetSendQuota(request);}

// Translation:
public virtual GetSendQuotaResponse GetSendQuota(GetSendQuotaRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetSendQuotaRequestMarshaller.Instance;options.ResponseUnmarshaller = GetSendQuotaResponseUnmarshaller.Instance;return Invoke<GetSendQuotaResponse>(request, options);}
// Original:
public FeatFormulaErr2(RecordInputStream in) {errorCheck = in.readInt();}

// Translation:
public FeatFormulaErr2(RecordInputStream in1){errorCheck = in1.ReadInt();}
// Original:
public DefineAnalysisSchemeResult defineAnalysisScheme(DefineAnalysisSchemeRequest request) {request = beforeClientExecution(request);return executeDefineAnalysisScheme(request);}

// Translation:
public virtual DefineAnalysisSchemeResponse DefineAnalysisScheme(DefineAnalysisSchemeRequest request){var options = new InvokeOptions();options.RequestMarshaller = DefineAnalysisSchemeRequestMarshaller.Instance;options.ResponseUnmarshaller = DefineAnalysisSchemeResponseUnmarshaller.Instance;return Invoke<DefineAnalysisSchemeResponse>(request, options);}
// Original:
public boolean equals( Object o ) {return o instanceof IrishStemmer;}

// Translation:
public override bool Equals(object o){return o is IrishStemmer;}
// Original:
public UTF8Sequence() {bytes = new UTF8Byte[4];for(int i=0;i<4;i++) {bytes[i] = new UTF8Byte();}}

// Translation:
public UTF8Sequence(){bytes = new UTF8Byte[4];for (int i = 0; i < 4; i++){bytes[i] = new UTF8Byte();}}
// Original:
public ListPhotosRequest() {super("CloudPhoto", "2017-07-11", "ListPhotos", "cloudphoto");setProtocol(ProtocolType.HTTPS);}

// Translation:
public ListPhotosRequest(): base("CloudPhoto", "2017-07-11", "ListPhotos", "cloudphoto", "openAPI"){Protocol = ProtocolType.HTTPS;}
// Original:
public RegisterStreamConsumerResult registerStreamConsumer(RegisterStreamConsumerRequest request) {request = beforeClientExecution(request);return executeRegisterStreamConsumer(request);}

// Translation:
public virtual RegisterStreamConsumerResponse RegisterStreamConsumer(RegisterStreamConsumerRequest request){var options = new InvokeOptions();options.RequestMarshaller = RegisterStreamConsumerRequestMarshaller.Instance;options.ResponseUnmarshaller = RegisterStreamConsumerResponseUnmarshaller.Instance;return Invoke<RegisterStreamConsumerResponse>(request, options);}
// Original:
public Formula copy() {return this;}

// Translation:
public Formula Copy(){return this;}
// Original:
public boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;MergeInfo other = (MergeInfo) obj;if (estimatedMergeBytes != other.estimatedMergeBytes)return false;if (isExternal != other.isExternal)return false;if (mergeMaxNumSegments != other.mergeMaxNumSegments)return false;if (totalMaxDoc != other.totalMaxDoc)return false;return true;}

// Translation:
public override bool Equals(object obj){if (this == obj){return true;}if (obj == null){return false;}if (this.GetType() != obj.GetType()){return false;}MergeInfo other = (MergeInfo)obj;if (EstimatedMergeBytes != other.EstimatedMergeBytes){return false;}if (IsExternal != other.IsExternal){return false;}if (MergeMaxNumSegments != other.MergeMaxNumSegments){return false;}if (TotalDocCount != other.TotalDocCount){return false;}return true;}
// Original:
public float score(float freq, long norm) {float sum = 0.0f;for (SimScorer subScorer : subScorers) {sum += subScorer.score(freq, norm);}return sum;}

// Translation:
public override float Score(int doc, float freq){float sum = 0.0f;foreach (SimScorer subScorer in subScorers){sum += subScorer.Score(doc, freq);}return sum;}
// Original:
public AddTagsRequest(String resourceId, java.util.List<Tag> tags) {setResourceId(resourceId);setTags(tags);}

// Translation:
public AddTagsRequest(string resourceId, List<Tag> tags){_resourceId = resourceId;_tags = tags;}
// Original:
public DescribeEC2InstanceLimitsResult describeEC2InstanceLimits(DescribeEC2InstanceLimitsRequest request) {request = beforeClientExecution(request);return executeDescribeEC2InstanceLimits(request);}

// Translation:
public virtual DescribeEC2InstanceLimitsResponse DescribeEC2InstanceLimits(DescribeEC2InstanceLimitsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeEC2InstanceLimitsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeEC2InstanceLimitsResponseUnmarshaller.Instance;return Invoke<DescribeEC2InstanceLimitsResponse>(request, options);}
// Original:
public BlameGenerator setFollowFileRenames(boolean follow) {if (follow)renameDetector = new RenameDetector(getRepository());elserenameDetector = null;return this;}

// Translation:
public virtual NGit.Blame.BlameGenerator SetFollowFileRenames(bool follow){if (follow){renameDetector = new RenameDetector(GetRepository());}else{renameDetector = null;}return this;}
// Original:
public GetStagesResult getStages(GetStagesRequest request) {request = beforeClientExecution(request);return executeGetStages(request);}

// Translation:
public virtual GetStagesResponse GetStages(GetStagesRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetStagesRequestMarshaller.Instance;options.ResponseUnmarshaller = GetStagesResponseUnmarshaller.Instance;return Invoke<GetStagesResponse>(request, options);}
// Original:
public void setParsedExpression(Ptg[] ptgs) {field_5_name_definition = Formula.create(ptgs);}

// Translation:
public void SetParsedExpression(Ptg[] ptgs){field_5_name_definition = Formula.Create(ptgs);}
// Original:
public int getRightId(int wordId) {return rightIds[wordId];}

// Translation:
public int GetRightId(int wordId){return RIGHT_ID;}
// Original:
public GetChangeRequest(String id) {setId(id);}

// Translation:
public GetChangeRequest(string id){_id = id;}
// Original:
public RegisterPhotoRequest() {super("CloudPhoto", "2017-07-11", "RegisterPhoto", "cloudphoto");setProtocol(ProtocolType.HTTPS);}

// Translation:
public RegisterPhotoRequest(): base("CloudPhoto", "2017-07-11", "RegisterPhoto", "cloudphoto", "openAPI"){Protocol = ProtocolType.HTTPS;}
// Original:
public void more() {_type = MORE;}

// Translation:
public virtual void More(){_type = TokenTypes.More;}
// Original:
public final Buffer position(int newPosition) {positionImpl(newPosition);return this;}

// Translation:
public java.nio.Buffer position(int newPosition){positionImpl(newPosition);return this;}
// Original:
public ScenarioProtectRecord(RecordInputStream in) {field_1_protect = in.readShort();}

// Translation:
public ScenarioProtectRecord(RecordInputStream in1){field_1_protect = in1.ReadShort();}
// Original:
public static TopFieldDocs merge(Sort sort, int topN, TopFieldDocs[] shardHits) {return merge(sort, 0, topN, shardHits);}

// Translation:
public static TopDocs Merge(Sort sort, int topN, TopDocs[] shardHits){return Merge(sort, 0, topN, shardHits);}
// Original:
public LexerModeAction(int mode) {this.mode = mode;}

// Translation:
public LexerModeAction(int mode){this.mode = mode;}
// Original:
public boolean canExecute(File f) {return false;}

// Translation:
public override bool CanExecute(FilePath f){return false;}
// Original:
public int preceding(int pos) {if (pos < text.getBeginIndex() || pos > text.getEndIndex()) {throw new IllegalArgumentException("offset out of bounds");} else if (0 == sentenceStarts.length) {text.setIndex(text.getBeginIndex());currentSentence = 0;return DONE;} else if (pos < sentenceStarts[0]) {text.setIndex(text.getBeginIndex());currentSentence = 0;return DONE;} else {currentSentence = sentenceStarts.length / 2; moveToSentenceAt(pos, 0, sentenceStarts.length - 1);if (0 == currentSentence) {text.setIndex(text.getBeginIndex());return DONE;} else {text.setIndex(sentenceStarts[--currentSentence]);return current();}}}

// Translation:
public override int Preceding(int pos){if (pos < text.BeginIndex || pos > text.EndIndex){throw new ArgumentException("offset out of bounds");}else if (0 == sentenceStarts.Length){text.SetIndex(text.BeginIndex);currentSentence = 0;return Done;}else if (pos < sentenceStarts[0]){text.SetIndex(text.BeginIndex);currentSentence = 0;return Done;}else{currentSentence = sentenceStarts.Length / 2; MoveToSentenceAt(pos, 0, sentenceStarts.Length - 1);if (0 == currentSentence){text.SetIndex(text.BeginIndex);return Done;}else{text.SetIndex(sentenceStarts[--currentSentence]);return Current;}}}
// Original:
public int serialize(int offset, byte[] data) {throw new RecordFormatException("Cannot serialize a dummy record");}

// Translation:
public override int Serialize(int offset, byte[] data){throw new RecordFormatException("Cannot serialize a dummy record");}
// Original:
public DetachObjectResult detachObject(DetachObjectRequest request) {request = beforeClientExecution(request);return executeDetachObject(request);}

// Translation:
public virtual DetachObjectResponse DetachObject(DetachObjectRequest request){var options = new InvokeOptions();options.RequestMarshaller = DetachObjectRequestMarshaller.Instance;options.ResponseUnmarshaller = DetachObjectResponseUnmarshaller.Instance;return Invoke<DetachObjectResponse>(request, options);}
// Original:
public WorkflowTypeDetail describeWorkflowType(DescribeWorkflowTypeRequest request) {request = beforeClientExecution(request);return executeDescribeWorkflowType(request);}

// Translation:
public virtual DescribeWorkflowTypeResponse DescribeWorkflowType(DescribeWorkflowTypeRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeWorkflowTypeRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeWorkflowTypeResponseUnmarshaller.Instance;return Invoke<DescribeWorkflowTypeResponse>(request, options);}
// Original:
public static void clearModels() {sentenceModels.clear();tokenizerModels.clear();posTaggerModels.clear();chunkerModels.clear();nerModels.clear();lemmaDictionaries.clear();}

// Translation:
public static void ClearModels(){sentenceModels.Clear();tokenizerModels.Clear();posTaggerModels.Clear();chunkerModels.Clear();nerModels.Clear();lemmaDictionaries.Clear();}
// Original:
public static String refLockFor(String name) {return name + LOCK_SUFFIX;}

// Translation:
public static string RefLockFor(string name){return name + LockFile.SUFFIX;}
// Original:
public DeleteComponentResult deleteComponent(DeleteComponentRequest request) {request = beforeClientExecution(request);return executeDeleteComponent(request);}

// Translation:
public virtual DeleteComponentResponse DeleteComponent(DeleteComponentRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteComponentRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteComponentResponseUnmarshaller.Instance;return Invoke<DeleteComponentResponse>(request, options);}
// Original:
public String toString() {StringBuilder sb = new StringBuilder();sb.append("[STYLE]\n");sb.append("    .xf_index_raw =").append(HexDump.shortToHex(field_1_xf_index)).append("\n");sb.append("        .type     =").append(isBuiltin() ? "built-in" : "user-defined").append("\n");sb.append("        .xf_index =").append(HexDump.shortToHex(getXFIndex())).append("\n");if (isBuiltin()){sb.append("    .builtin_style=").append(HexDump.byteToHex(field_2_builtin_style)).append("\n");sb.append("    .outline_level=").append(HexDump.byteToHex(field_3_outline_style_level)).append("\n");} else {sb.append("    .name        =").append(getName()).append("\n");}sb.append("[/STYLE]\n");return sb.toString();}

// Translation:
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[STYLE]\n");buffer.Append("    .xf_index_raw    = ").Append(HexDump.ShortToHex(field_1_xf_index)).Append("\n");buffer.Append("        .type        = ").Append(IsBuiltin?"built-in":"user-defined").Append("\n");buffer.Append("        .xf_index    = ").Append(HexDump.ShortToHex(XFIndex)).Append("\n");if (IsBuiltin){buffer.Append("    .builtin_style   = ").Append(HexDump.ByteToHex(field_2_builtin_style)).Append("\n");buffer.Append("    .outline_level   = ").Append(HexDump.ByteToHex(field_3_outline_style_level)).Append("\n");}else{buffer.Append("    .name            = ").Append(Name).Append("\n");}buffer.Append("[/STYLE]\n");return buffer.ToString();}
// Original:
public DescribeAuditStreamConfigurationResult describeAuditStreamConfiguration(DescribeAuditStreamConfigurationRequest request) {request = beforeClientExecution(request);return executeDescribeAuditStreamConfiguration(request);}

// Translation:
public virtual DescribeAuditStreamConfigurationResponse DescribeAuditStreamConfiguration(DescribeAuditStreamConfigurationRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeAuditStreamConfigurationRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeAuditStreamConfigurationResponseUnmarshaller.Instance;return Invoke<DescribeAuditStreamConfigurationResponse>(request, options);}
// Original:
public String toString() {if (getChildren() == null || getChildren().size() == 0)return "<any field='" + this.field + "'  matchelements="+ this.minimumMatchingmElements + "/>";StringBuilder sb = new StringBuilder();sb.append("<any field='").append(this.field).append("'  matchelements=").append(this.minimumMatchingmElements).append('>');for (QueryNode clause : getChildren()) {sb.append("\n");sb.append(clause.toString());}sb.append("\n</any>");return sb.toString();}

// Translation:
public override string ToString(){var children = GetChildren();if (children == null || children.Count == 0)return "<any field='" + this.field + "'  matchelements="+ this.minimumMatchingmElements + "/>";StringBuilder sb = new StringBuilder();sb.Append("<any field='" + this.field + "'  matchelements="+ this.minimumMatchingmElements + ">");foreach (IQueryNode clause in children){sb.Append("\n");sb.Append(clause.ToString());}sb.Append("\n</any>");return sb.ToString();}
// Original:
public AssociateSkillWithSkillGroupResult associateSkillWithSkillGroup(AssociateSkillWithSkillGroupRequest request) {request = beforeClientExecution(request);return executeAssociateSkillWithSkillGroup(request);}

// Translation:
public virtual AssociateSkillWithSkillGroupResponse AssociateSkillWithSkillGroup(AssociateSkillWithSkillGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = AssociateSkillWithSkillGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = AssociateSkillWithSkillGroupResponseUnmarshaller.Instance;return Invoke<AssociateSkillWithSkillGroupResponse>(request, options);}
// Original:
public String getFetchedFrom() {return this.fetchedFrom;}

// Translation:
public virtual string GetFetchedFrom(){return this.fetchedFrom;}
// Original:
public static Counter newCounter(boolean threadSafe) {return threadSafe ? new AtomicCounter() : new SerialCounter();}

// Translation:
public static Counter NewCounter(bool threadSafe){return threadSafe ? (Counter)new AtomicCounter() : new SerialCounter();}
// Original:
public FloatBuffer slice() {return new ReadWriteFloatArrayBuffer(remaining(), backingArray, offset + position);}

// Translation:
public override java.nio.FloatBuffer slice(){return new java.nio.ReadWriteFloatArrayBuffer(remaining(), backingArray, offset +_position);}
// Original:
public ListProcessingJobsResult listProcessingJobs(ListProcessingJobsRequest request) {request = beforeClientExecution(request);return executeListProcessingJobs(request);}

// Translation:
public virtual ListProcessingJobsResponse ListProcessingJobs(ListProcessingJobsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListProcessingJobsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListProcessingJobsResponseUnmarshaller.Instance;return Invoke<ListProcessingJobsResponse>(request, options);}
// Original:
public void recover(RecognitionException re) {_input.consume();}

// Translation:
public virtual void Recover(RecognitionException re){_input.Consume();}
// Original:
public CreateTemplateAliasResult createTemplateAlias(CreateTemplateAliasRequest request) {request = beforeClientExecution(request);return executeCreateTemplateAlias(request);}

// Translation:
public virtual CreateTemplateAliasResponse CreateTemplateAlias(CreateTemplateAliasRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateTemplateAliasRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateTemplateAliasResponseUnmarshaller.Instance;return Invoke<CreateTemplateAliasResponse>(request, options);}
// Original:
public final Buffer reset() {if (mark == UNSET_MARK) {throw new InvalidMarkException("Mark not set");}position = mark;return this;}

// Translation:
public java.nio.Buffer reset(){if (_mark == UNSET_MARK){throw new java.nio.InvalidMarkException("Mark not set");}_position = _mark;return this;}
// Original:
@Override public synchronized boolean equals(Object object) {return (object instanceof Map) &&entrySet().equals(((Map<?, ?>)object).entrySet());}

// Translation:
public override bool Equals(object @object){lock (this){return (@object is java.util.Map<K, V>) && entrySet().Equals(((java.util.Map<object, object>)@object).entrySet());}}
// Original:
public void tagResource(TagResourceRequest request) {request = beforeClientExecution(request);executeTagResource(request);}

// Translation:
public virtual TagResourceResponse TagResource(TagResourceRequest request){var options = new InvokeOptions();options.RequestMarshaller = TagResourceRequestMarshaller.Instance;options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;return Invoke<TagResourceResponse>(request, options);}
// Original:
public BytesRef common(BytesRef output1, BytesRef output2) {assert output1 != null;assert output2 != null;int pos1 = output1.offset;int pos2 = output2.offset;int stopAt1 = pos1 + Math.min(output1.length, output2.length);while(pos1 < stopAt1) {if (output1.bytes[pos1] != output2.bytes[pos2]) {break;}pos1++;pos2++;}if (pos1 == output1.offset) {return NO_OUTPUT;} else if (pos1 == output1.offset + output1.length) {return output1;} else if (pos2 == output2.offset + output2.length) {return output2;} else {return new BytesRef(output1.bytes, output1.offset, pos1-output1.offset);}}

// Translation:
public override BytesRef Common(BytesRef output1, BytesRef output2){Debug.Assert(output1 != null);Debug.Assert(output2 != null);int pos1 = output1.Offset;int pos2 = output2.Offset;int stopAt1 = pos1 + Math.Min(output1.Length, output2.Length);while (pos1 < stopAt1){if (output1.Bytes[pos1] != output2.Bytes[pos2]){break;}pos1++;pos2++;}if (pos1 == output1.Offset){return NO_OUTPUT;}else if (pos1 == output1.Offset + output1.Length){return output1;}else if (pos2 == output2.Offset + output2.Length){return output2;}else{return new BytesRef(output1.Bytes, output1.Offset, pos1 - output1.Offset);}}
// Original:
public E getFirst() {return getFirstImpl();}

// Translation:
public virtual E getFirst(){return getFirstImpl();}
// Original:
public ObjectId computeId(ObjectInserter ins) {if (buf != null)return ins.idFor(OBJ_TREE, buf, 0, ptr);final long len = overflowBuffer.length();try {return ins.idFor(OBJ_TREE, len, overflowBuffer.openInputStream());} catch (IOException e) {throw new RuntimeException(e);}}

// Translation:
public virtual ObjectId ComputeId(ObjectInserter ins){if (buf != null){return ins.IdFor(Constants.OBJ_TREE, buf, 0, ptr);}long len = overflowBuffer.Length();try{return ins.IdFor(Constants.OBJ_TREE, len, overflowBuffer.OpenInputStream());}catch (IOException e){throw new RuntimeException(e);}}
// Original:
public TransferDomainResult transferDomain(TransferDomainRequest request) {request = beforeClientExecution(request);return executeTransferDomain(request);}

// Translation:
public virtual TransferDomainResponse TransferDomain(TransferDomainRequest request){var options = new InvokeOptions();options.RequestMarshaller = TransferDomainRequestMarshaller.Instance;options.ResponseUnmarshaller = TransferDomainResponseUnmarshaller.Instance;return Invoke<TransferDomainResponse>(request, options);}
// Original:
public String toString() {synchronized (lock) {return new String(buf, 0, count);}}

// Translation:
public override string ToString(){lock (@lock){return new string(buf, 0, count);}}
// Original:
public DescribeReservedNodeOfferingsResult describeReservedNodeOfferings(DescribeReservedNodeOfferingsRequest request) {request = beforeClientExecution(request);return executeDescribeReservedNodeOfferings(request);}

// Translation:
public virtual DescribeReservedNodeOfferingsResponse DescribeReservedNodeOfferings(DescribeReservedNodeOfferingsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeReservedNodeOfferingsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeReservedNodeOfferingsResponseUnmarshaller.Instance;return Invoke<DescribeReservedNodeOfferingsResponse>(request, options);}
// Original:
public String toString(String field) {StringBuilder buffer = new StringBuilder();if (!term.field().equals(field)) {buffer.append(term.field());buffer.append(":");}buffer.append(term.text());return buffer.toString();}

// Translation:
public override string ToString(string field){StringBuilder buffer = new StringBuilder();if (!term.Field.Equals(field, StringComparison.Ordinal)){buffer.Append(term.Field);buffer.Append(":");}buffer.Append(term.Text());buffer.Append(ToStringUtils.Boost(Boost));return buffer.ToString();}
// Original:
public IntBuffer duplicate() {ByteBuffer bb = byteBuffer.duplicate().order(byteBuffer.order());IntToByteBufferAdapter buf = new IntToByteBufferAdapter(bb);buf.limit = limit;buf.position = position;buf.mark = mark;return buf;}

// Translation:
public override java.nio.IntBuffer duplicate(){java.nio.ByteBuffer bb = byteBuffer.duplicate().order(byteBuffer.order());java.nio.IntToByteBufferAdapter buf = new java.nio.IntToByteBufferAdapter(bb);buf._limit = _limit;buf._position = _position;buf._mark = _mark;return buf;}