yijunyu/c-to-rust huggingface dataset:
// Original:
public static Ptg[] getTokens(Formula formula) {if (formula == null) {return null;}return formula.getTokens();}

// Translation:
public static Ptg[] GetTokens(Formula formula){if (formula == null){return null;}return formula.Tokens;}
// Original:
public void skipToNextByte() {remainingBits = 0;}

// Translation:
public void SkipToNextByte(){remainingBits = 0;}
// Original:
public GetJourneyExecutionActivityMetricsResult getJourneyExecutionActivityMetrics(GetJourneyExecutionActivityMetricsRequest request) {request = beforeClientExecution(request);return executeGetJourneyExecutionActivityMetrics(request);}

// Translation:
public virtual GetJourneyExecutionActivityMetricsResponse GetJourneyExecutionActivityMetrics(GetJourneyExecutionActivityMetricsRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetJourneyExecutionActivityMetricsRequestMarshaller.Instance;options.ResponseUnmarshaller = GetJourneyExecutionActivityMetricsResponseUnmarshaller.Instance;return Invoke<GetJourneyExecutionActivityMetricsResponse>(request, options);}
// Original:
public DeregisterContainerInstanceResult deregisterContainerInstance(DeregisterContainerInstanceRequest request) {request = beforeClientExecution(request);return executeDeregisterContainerInstance(request);}

// Translation:
public virtual DeregisterContainerInstanceResponse DeregisterContainerInstance(DeregisterContainerInstanceRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeregisterContainerInstanceRequestMarshaller.Instance;options.ResponseUnmarshaller = DeregisterContainerInstanceResponseUnmarshaller.Instance;return Invoke<DeregisterContainerInstanceResponse>(request, options);}
// Original:
public DeleteEntityRecognizerResult deleteEntityRecognizer(DeleteEntityRecognizerRequest request) {request = beforeClientExecution(request);return executeDeleteEntityRecognizer(request);}

// Translation:
public virtual DeleteEntityRecognizerResponse DeleteEntityRecognizer(DeleteEntityRecognizerRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteEntityRecognizerRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteEntityRecognizerResponseUnmarshaller.Instance;return Invoke<DeleteEntityRecognizerResponse>(request, options);}
// Original:
public DescribeGameSessionsResult describeGameSessions(DescribeGameSessionsRequest request) {request = beforeClientExecution(request);return executeDescribeGameSessions(request);}

// Translation:
public virtual DescribeGameSessionsResponse DescribeGameSessions(DescribeGameSessionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeGameSessionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeGameSessionsResponseUnmarshaller.Instance;return Invoke<DescribeGameSessionsResponse>(request, options);}
// Original:
public SegToken(char[] idArray, int start, int end, int wordType, int weight) {this.charArray = idArray;this.startOffset = start;this.endOffset = end;this.wordType = wordType;this.weight = weight;}

// Translation:
public SegToken(char[] idArray, int start, int end, WordType wordType, int weight){this.CharArray = idArray;this.StartOffset = start;this.EndOffset = end;this.WordType = wordType;this.Weight = weight;}
// Original:
public int compareTo( TermInfo o ){return ( this.position - o.position );}

// Translation:
public virtual int CompareTo(TermInfo o){return (this.position - o.position);}
// Original:
public TagMeetingResult tagMeeting(TagMeetingRequest request) {request = beforeClientExecution(request);return executeTagMeeting(request);}

// Translation:
public virtual TagMeetingResponse TagMeeting(TagMeetingRequest request){var options = new InvokeOptions();options.RequestMarshaller = TagMeetingRequestMarshaller.Instance;options.ResponseUnmarshaller = TagMeetingResponseUnmarshaller.Instance;return Invoke<TagMeetingResponse>(request, options);}
// Original:
public final Buffer limit(int newLimit) {limitImpl(newLimit);return this;}

// Translation:
public java.nio.Buffer limit(int newLimit){limitImpl(newLimit);return this;}
// Original:
public final DoubleValuesSource makeRecipDistanceValueSource(Shape queryShape) {Rectangle bbox = queryShape.getBoundingBox();double diagonalDist = ctx.getDistCalc().distance(ctx.makePoint(bbox.getMinX(), bbox.getMinY()), bbox.getMaxX(), bbox.getMaxY());double distToEdge = diagonalDist * 0.5;float c = (float)distToEdge * 0.1f;DoubleValuesSource distance = makeDistanceValueSource(queryShape.getCenter(), 1.0);return new ReciprocalDoubleValuesSource(c, distance);}

// Translation:
public ValueSource MakeRecipDistanceValueSource(IShape queryShape){IRectangle bbox = queryShape.BoundingBox;double diagonalDist = m_ctx.DistCalc.Distance(m_ctx.MakePoint(bbox.MinX, bbox.MinY), bbox.MaxX, bbox.MaxY);double distToEdge = diagonalDist * 0.5;float c = (float)distToEdge * 0.1f; return new ReciprocalSingleFunction(MakeDistanceValueSource(queryShape.Center, 1.0), 1f, c, c);}
// Original:
public GetLoginProfileRequest(String userName) {setUserName(userName);}

// Translation:
public GetLoginProfileRequest(string userName){_userName = userName;}
// Original:
public int serializeComplexPart( byte[] data, int pos ){return 0;}

// Translation:
public override int SerializeComplexPart(byte[] data, int pos){return 0;}
// Original:
public DBCellRecord(int rowOffset, short[] cellOffsets) {field_1_row_offset = rowOffset;field_2_cell_offsets = cellOffsets;}

// Translation:
public DBCellRecord(int rowOffset, short[]cellOffsets) {field_1_row_offset = rowOffset;field_2_cell_offsets = cellOffsets;}
// Original:
public StoredField(String name, long value) {super(name, TYPE);fieldsData = value;}

// Translation:
public StoredField(string name, int value): base(name, TYPE){FieldsData = new Int32(value);}
// Original:
public final Locale getLocale() {return locale;}

// Translation:
public CultureInfo GetLocale(){return locale;}
// Original:
public SpanNotBuilder(SpanQueryBuilder factory) {this.factory = factory;}

// Translation:
public SpanNotBuilder(ISpanQueryBuilder factory){this.factory = factory;}
// Original:
public String toString() {return toString(0);}

// Translation:
public override string ToString(){return ToString(Info.Dir, 0);}
// Original:
public int compareTo(ExtRst o) {int result;result = reserved - o.reserved;if (result != 0) {return result;}result = formattingFontIndex - o.formattingFontIndex;if (result != 0) {return result;}result = formattingOptions - o.formattingOptions;if (result != 0) {return result;}result = numberOfRuns - o.numberOfRuns;if (result != 0) {return result;}result = phoneticText.compareTo(o.phoneticText);if (result != 0) {return result;}result = phRuns.length - o.phRuns.length;if (result != 0) {return result;}for(int i=0; i<phRuns.length; i++) {result = phRuns[i].phoneticTextFirstCharacterOffset - o.phRuns[i].phoneticTextFirstCharacterOffset;if (result != 0) {return result;}result = phRuns[i].realTextFirstCharacterOffset - o.phRuns[i].realTextFirstCharacterOffset;if (result != 0) {return result;}result = phRuns[i].realTextLength - o.phRuns[i].realTextLength;if (result != 0) {return result;}}result = Arrays.hashCode(extraData)-Arrays.hashCode(o.extraData);return result;}

// Translation:
public int CompareTo(ExtRst o){int result;result = reserved - o.reserved;if (result != 0) return result;result = formattingFontIndex - o.formattingFontIndex;if (result != 0) return result;result = formattingOptions - o.formattingOptions;if (result != 0) return result;result = numberOfRuns - o.numberOfRuns;if (result != 0) return result;result = string.Compare(phoneticText, o.phoneticText, StringComparison.CurrentCulture);if (result != 0) return result;result = phRuns.Length - o.phRuns.Length;if (result != 0) return result;for (int i = 0; i < phRuns.Length; i++){result = phRuns[i].phoneticTextFirstCharacterOffset - o.phRuns[i].phoneticTextFirstCharacterOffset;if (result != 0) return result;result = phRuns[i].realTextFirstCharacterOffset - o.phRuns[i].realTextFirstCharacterOffset;if (result != 0) return result;result = phRuns[i].realTextLength - o.phRuns[i].realTextLength;if (result != 0) return result;}result = Arrays.HashCode(extraData) - Arrays.HashCode(o.extraData);return result;}
// Original:
public GetInstanceSnapshotsResult getInstanceSnapshots(GetInstanceSnapshotsRequest request) {request = beforeClientExecution(request);return executeGetInstanceSnapshots(request);}

// Translation:
public virtual GetInstanceSnapshotsResponse GetInstanceSnapshots(GetInstanceSnapshotsRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetInstanceSnapshotsRequestMarshaller.Instance;options.ResponseUnmarshaller = GetInstanceSnapshotsResponseUnmarshaller.Instance;return Invoke<GetInstanceSnapshotsResponse>(request, options);}
// Original:
public static long[] grow(long[] array) {return grow(array, 1 + array.length);}

// Translation:
public static short[] Grow(short[] array){return Grow(array, 1 + array.Length);}
// Original:
public TranslateTextResult translateText(TranslateTextRequest request) {request = beforeClientExecution(request);return executeTranslateText(request);}

// Translation:
public virtual TranslateTextResponse TranslateText(TranslateTextRequest request){var options = new InvokeOptions();options.RequestMarshaller = TranslateTextRequestMarshaller.Instance;options.ResponseUnmarshaller = TranslateTextResponseUnmarshaller.Instance;return Invoke<TranslateTextResponse>(request, options);}
// Original:
public DimensionsRecord(RecordInputStream in) {field_1_first_row = in.readInt();field_2_last_row  = in.readInt();field_3_first_col = in.readShort();field_4_last_col  = in.readShort();field_5_zero      = in.readShort();if (in.available() == 2) {logger.log(POILogger.INFO, "DimensionsRecord has extra 2 bytes.");in.readShort();}}

// Translation:
public DimensionsRecord(RecordInputStream in1){field_1_first_row = in1.ReadInt();field_2_last_row = in1.ReadInt();field_3_first_col = in1.ReadShort();field_4_last_col = in1.ReadShort();field_5_zero = in1.ReadShort();}
// Original:
public int flags() {return flags;}

// Translation:
public int flags(){return _flags;}
// Original:
public Vector(int capacity, int capacityIncrement) {if (capacity < 0) {throw new IllegalArgumentException();}elementData = newElementArray(capacity);elementCount = 0;this.capacityIncrement = capacityIncrement;}

// Translation:
public Vector(int capacity_1, int capacityIncrement){if (capacity_1 < 0){throw new System.ArgumentException();}elementData = new object[capacity_1];elementCount = 0;this.capacityIncrement = capacityIncrement;}
// Original:
public DeleteLogGroupRequest(String logGroupName) {setLogGroupName(logGroupName);}

// Translation:
public DeleteLogGroupRequest(string logGroupName){_logGroupName = logGroupName;}
// Original:
public RemoveManagedScalingPolicyResult removeManagedScalingPolicy(RemoveManagedScalingPolicyRequest request) {request = beforeClientExecution(request);return executeRemoveManagedScalingPolicy(request);}

// Translation:
public virtual RemoveManagedScalingPolicyResponse RemoveManagedScalingPolicy(RemoveManagedScalingPolicyRequest request){var options = new InvokeOptions();options.RequestMarshaller = RemoveManagedScalingPolicyRequestMarshaller.Instance;options.ResponseUnmarshaller = RemoveManagedScalingPolicyResponseUnmarshaller.Instance;return Invoke<RemoveManagedScalingPolicyResponse>(request, options);}
// Original:
public GetDataRetrievalPolicyResult getDataRetrievalPolicy(GetDataRetrievalPolicyRequest request) {request = beforeClientExecution(request);return executeGetDataRetrievalPolicy(request);}

// Translation:
public virtual GetDataRetrievalPolicyResponse GetDataRetrievalPolicy(GetDataRetrievalPolicyRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetDataRetrievalPolicyRequestMarshaller.Instance;options.ResponseUnmarshaller = GetDataRetrievalPolicyResponseUnmarshaller.Instance;return Invoke<GetDataRetrievalPolicyResponse>(request, options);}
// Original:
public DescribeExportImageTasksResult describeExportImageTasks(DescribeExportImageTasksRequest request) {request = beforeClientExecution(request);return executeDescribeExportImageTasks(request);}

// Translation:
public virtual DescribeExportImageTasksResponse DescribeExportImageTasks(DescribeExportImageTasksRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeExportImageTasksRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeExportImageTasksResponseUnmarshaller.Instance;return Invoke<DescribeExportImageTasksResponse>(request, options);}
// Original:
public DefaultICUTokenizerConfig(boolean cjkAsWords, boolean myanmarAsWords) {this.cjkAsWords = cjkAsWords;this.myanmarAsWords = myanmarAsWords;}

// Translation:
public DefaultICUTokenizerConfig(bool cjkAsWords, bool myanmarAsWords){this.cjkAsWords = cjkAsWords;this.myanmarAsWords = myanmarAsWords;}
// Original:
public DisableAvailabilityZonesForLoadBalancerResult disableAvailabilityZonesForLoadBalancer(DisableAvailabilityZonesForLoadBalancerRequest request) {request = beforeClientExecution(request);return executeDisableAvailabilityZonesForLoadBalancer(request);}

// Translation:
public virtual DisableAvailabilityZonesForLoadBalancerResponse DisableAvailabilityZonesForLoadBalancer(DisableAvailabilityZonesForLoadBalancerRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisableAvailabilityZonesForLoadBalancerRequestMarshaller.Instance;options.ResponseUnmarshaller = DisableAvailabilityZonesForLoadBalancerResponseUnmarshaller.Instance;return Invoke<DisableAvailabilityZonesForLoadBalancerResponse>(request, options);}
// Original:
public synchronized void setIndexFieldName(String dimName, String indexFieldName) {DimConfig ft = fieldTypes.get(dimName);if (ft == null) {ft = new DimConfig();fieldTypes.put(dimName, ft);}ft.indexFieldName = indexFieldName;}

// Translation:
public virtual void SetIndexFieldName(string dimName, string indexFieldName){lock (this){if (!fieldTypes.TryGetValue(dimName, out DimConfig fieldType)){fieldTypes[dimName] = new DimConfig { IndexFieldName = indexFieldName };}else{fieldType.IndexFieldName = indexFieldName;}}}
// Original:
public BytesRef encode(char[] buffer, int offset, int length) {int payload = ArrayUtil.parseInt(buffer, offset, length);byte[] bytes = PayloadHelper.encodeInt(payload);BytesRef result = new BytesRef(bytes);return result;}

// Translation:
public override BytesRef Encode(char[] buffer, int offset, int length){int payload = ArrayUtil.ParseInt32(buffer, offset, length); byte[] bytes = PayloadHelper.EncodeInt32(payload);BytesRef result = new BytesRef(bytes);return result;}
// Original:
public HideObjRecord(RecordInputStream in) {field_1_hide_obj = in.readShort();}

// Translation:
public HideObjRecord(RecordInputStream in1){field_1_hide_obj = in1.ReadShort();}
// Original:
public String toString() {if ( isEmpty() ) return "[]";StringBuilder buf = new StringBuilder();buf.append("[");for (int i=0; i<returnStates.length; i++) {if ( i>0 ) buf.append(", ");if ( returnStates[i]==EMPTY_RETURN_STATE ) {buf.append("$");continue;}buf.append(returnStates[i]);if ( parents[i]!=null ) {buf.append(' ');buf.append(parents[i].toString());}else {buf.append("null");}}buf.append("]");return buf.toString();}

// Translation:
public override String ToString(){if (IsEmpty)return "[]";StringBuilder buf = new StringBuilder();buf.Append("[");for (int i = 0; i < returnStates.Length; i++){if (i > 0) buf.Append(", ");if (returnStates[i] == EMPTY_RETURN_STATE){buf.Append("$");continue;}buf.Append(returnStates[i]);if (parents[i] != null){buf.Append(' ');buf.Append(parents[i].ToString());}else {buf.Append("null");}}buf.Append("]");return buf.ToString();}
// Original:
public synchronized int getSecondaryProgress() {return mIndeterminate ? 0 : mSecondaryProgress;}

// Translation:
public virtual int getSecondaryProgress(){lock (this){return mIndeterminate ? 0 : mSecondaryProgress;}}
// Original:
public DeleteContactMethodResult deleteContactMethod(DeleteContactMethodRequest request) {request = beforeClientExecution(request);return executeDeleteContactMethod(request);}

// Translation:
public virtual DeleteContactMethodResponse DeleteContactMethod(DeleteContactMethodRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteContactMethodRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteContactMethodResponseUnmarshaller.Instance;return Invoke<DeleteContactMethodResponse>(request, options);}
// Original:
@Override public List<E> subList(int start, int end) {synchronized (mutex) {return new SynchronizedList<E>(list.subList(start, end), mutex);}}

// Translation:
public virtual java.util.List<E> subList(int start, int end){lock (mutex){return new java.util.Collections.SynchronizedList<E>(list.subList(start, end), mutex);}}
// Original:
@Override public boolean equals(Object object) {return m.equals(object);}

// Translation:
public override bool Equals(object @object){return mapEntry.Equals(@object);}
// Original:
public static String getSchemePrefix(String spec) {int colon = spec.indexOf(':');if (colon < 1) {return null;}for (int i = 0; i < colon; i++) {char c = spec.charAt(i);if (!isValidSchemeChar(i, c)) {return null;}}return spec.substring(0, colon).toLowerCase(Locale.US);}

// Translation:
public static string getSchemePrefix(string spec){int colon = spec.IndexOf(':');if (colon < 1){return null;}{for (int i = 0; i < colon; i++){char c = spec[i];if (!isValidSchemeChar(i, c)){return null;}}}return Sharpen.StringHelper.Substring(spec, 0, colon).ToLower(System.Globalization.CultureInfo.InvariantCulture);}
// Original:
public ByteBuffer put(byte[] src, int srcOffset, int byteCount) {throw new ReadOnlyBufferException();}

// Translation:
public override java.nio.ByteBuffer put(byte[] src, int srcOffset, int byteCount){throw new System.NotImplementedException();}
// Original:
public CreateServiceResult createService(CreateServiceRequest request) {request = beforeClientExecution(request);return executeCreateService(request);}

// Translation:
public virtual CreateServiceResponse CreateService(CreateServiceRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateServiceRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateServiceResponseUnmarshaller.Instance;return Invoke<CreateServiceResponse>(request, options);}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(_numberOfRegions);for (int i = 0; i < _numberOfRegions; i++) {_regions[_startIndex + i].serialize(out);}}

// Translation:
public override void Serialize(ILittleEndianOutput out1){int nItems = _numberOfRegions;out1.WriteShort(nItems);for (int i = 0; i < _numberOfRegions; i++){_regions[_startIndex + i].Serialize(out1);}}
// Original:
public StringBuilder insert(int offset, char c) {insert0(offset, c);return this;}

// Translation:
public java.lang.StringBuilder insert(int offset, char c){insert0(offset, c);return this;}
// Original:
public LabelSSTRecord(RecordInputStream in) {super(in);field_4_sst_index = in.readInt();}

// Translation:
public LabelSSTRecord(RecordInputStream in1): base(in1){field_4_sst_index = in1.ReadInt();}
// Original:
public void setObjectId(AnyObjectId id) {if (objectId == null)objectId = id.copy();}

// Translation:
public virtual void SetObjectId(AnyObjectId id){if (objectId == null){objectId = id.Copy();}}
// Original:
public int add(CFRecordsAggregate cfAggregate) {cfAggregate.getHeader().setID(_cfHeaders.size());_cfHeaders.add(cfAggregate);return _cfHeaders.size() - 1;}

// Translation:
public int Add(CFRecordsAggregate cfAggregate){_cfHeaders.Add(cfAggregate);return _cfHeaders.Count - 1;}
// Original:
public TermVectorsPostingsArray(int size) {super(size);freqs = new int[size];lastOffsets = new int[size];lastPositions = new int[size];}

// Translation:
public TermVectorsPostingsArray(int size): base(size){freqs = new int[size];lastOffsets = new int[size];lastPositions = new int[size];}
// Original:
public FieldsQuery(SrndQuery q, List<String> fieldNames, char fieldOp) {this.q = q;this.fieldNames = fieldNames;this.fieldOp = fieldOp;}

// Translation:
public FieldsQuery(SrndQuery q, IList<string> fieldNames, char fieldOp){this.q = q;this.fieldNames = fieldNames;this.fieldOp = fieldOp;}
// Original:
public TokenStream create(TokenStream in) {return new GreekLowerCaseFilter(in);}

// Translation:
public override TokenStream Create(TokenStream @in){return new GreekLowerCaseFilter(m_luceneMatchVersion, @in);}
// Original:
public ECSMetadataServiceCredentialsFetcher() {this.connectionTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MILLISECONDS;}

// Translation:
public ECSMetadataServiceCredentialsFetcher(){connectionTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MILLISECONDS;}
// Original:
public static Decoder getDecoder(Format format, int version, int bitsPerValue) {checkVersion(version);return BulkOperation.of(format, bitsPerValue);}

// Translation:
public static IDecoder GetDecoder(Format format, int version, int bitsPerValue){CheckVersion(version);return BulkOperation.Of(format, bitsPerValue);}
// Original:
public synchronized void reset() {nameFinder.clearAdaptiveData();}

// Translation:
public virtual void Reset(){lock (this){nameFinder.clearAdaptiveData();}}
// Original:
public String nextKeyString() {return new String(nextKey());}

// Translation:
public virtual string NextKeyString(){return new string(NextKey());}
// Original:
public DescribeEventsResult describeEvents() {return describeEvents(new DescribeEventsRequest());}

// Translation:
public virtual DescribeEventsResponse DescribeEvents(){return DescribeEvents(new DescribeEventsRequest());}
// Original:
public UpdateNodeResult updateNode(UpdateNodeRequest request) {request = beforeClientExecution(request);return executeUpdateNode(request);}

// Translation:
public virtual UpdateNodeResponse UpdateNode(UpdateNodeRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateNodeRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateNodeResponseUnmarshaller.Instance;return Invoke<UpdateNodeResponse>(request, options);}
// Original:
public GetJobOutputRequest(String vaultName, String jobId, String range) {setVaultName(vaultName);setJobId(jobId);setRange(range);}

// Translation:
public GetJobOutputRequest(string vaultName, string jobId, string range){_vaultName = vaultName;_jobId = jobId;_range = range;}
// Original:
public static String stripTags(String buf, int start) {if (start>0) {buf = buf.substring(start);}return buf.replaceAll("<[^>]*>", " ");}

// Translation:
public static string StripTags(string buf, int start){if (start > 0){buf = buf.Substring(0);}return Regex.Replace(buf, "<[^>]*>", " ");}
// Original:
public DescribeLaunchTemplatesResult describeLaunchTemplates(DescribeLaunchTemplatesRequest request) {request = beforeClientExecution(request);return executeDescribeLaunchTemplates(request);}

// Translation:
public virtual DescribeLaunchTemplatesResponse DescribeLaunchTemplates(DescribeLaunchTemplatesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeLaunchTemplatesRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeLaunchTemplatesResponseUnmarshaller.Instance;return Invoke<DescribeLaunchTemplatesResponse>(request, options);}