yijunyu/c-to-rust huggingface dataset:
// Original:
public String toString() {return "<phraseslop value='" + getValueString() + "'>" + "\n"+ getChild().toString() + "\n</phraseslop>";}

// Translation:
public override string ToString(){return "<phraseslop value='" + GetValueString() + "'>" + "\n"+ GetChild().ToString() + "\n</phraseslop>";}
// Original:
public DirCacheEntry getDirCacheEntry() {return currentSubtree == null ? currentEntry : null;}

// Translation:
public virtual DirCacheEntry GetDirCacheEntry(){return currentSubtree == null ? currentEntry : null;}
// Original:
public IntBuffer put(int[] src, int srcOffset, int intCount) {Arrays.checkOffsetAndCount(src.length, srcOffset, intCount);if (intCount > remaining()) {throw new BufferOverflowException();}for (int i = srcOffset; i < srcOffset + intCount; ++i) {put(src[i]);}return this;}

// Translation:
public virtual java.nio.IntBuffer put(int[] src, int srcOffset, int intCount){java.util.Arrays.checkOffsetAndCount(src.Length, srcOffset, intCount);if (intCount > remaining()){throw new java.nio.BufferOverflowException();}{for (int i = srcOffset; i < srcOffset + intCount; ++i){put(src[i]);}}return this;}
// Original:
public void trimToSize() {int s = size;if (s == array.length) {return;}if (s == 0) {array = EmptyArray.OBJECT;} else {Object[] newArray = new Object[s];System.arraycopy(array, 0, newArray, 0, s);array = newArray;}modCount++;}

// Translation:
public virtual void trimToSize(){int s = _size;if (s == array.Length){return;}if (s == 0){array = libcore.util.EmptyArray.OBJECT;}else{object[] newArray = new object[s];System.Array.Copy(array, 0, newArray, 0, s);array = newArray;}modCount++;}
// Original:
public DescribeLocalGatewayVirtualInterfacesResult describeLocalGatewayVirtualInterfaces(DescribeLocalGatewayVirtualInterfacesRequest request) {request = beforeClientExecution(request);return executeDescribeLocalGatewayVirtualInterfaces(request);}

// Translation:
public virtual DescribeLocalGatewayVirtualInterfacesResponse DescribeLocalGatewayVirtualInterfaces(DescribeLocalGatewayVirtualInterfacesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeLocalGatewayVirtualInterfacesRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeLocalGatewayVirtualInterfacesResponseUnmarshaller.Instance;return Invoke<DescribeLocalGatewayVirtualInterfacesResponse>(request, options);}
// Original:
public TokenStream create(TokenStream input) {return new RussianLightStemFilter(input);}

// Translation:
public override TokenStream Create(TokenStream input){return new RussianLightStemFilter(input);}
// Original:
public int [] toArray(final int [] a){int[] rval;if (a.length == _limit){System.arraycopy(_array, 0, a, 0, _limit);rval = a;}else{rval = toArray();}return rval;}

// Translation:
public int[] ToArray(int[] a){int[] rval;if (a.Length == _limit){Array.Copy(_array, 0, a, 0, _limit);rval = a;}else{rval = ToArray();}return rval;}
// Original:
public BasicSessionCredentials(String accessKeyId, String accessKeySecret, String sessionToken,long roleSessionDurationSeconds) {if (accessKeyId == null) {throw new IllegalArgumentException("Access key ID cannot be null.");}if (accessKeySecret == null) {throw new IllegalArgumentException("Access key secret cannot be null.");}this.accessKeyId = accessKeyId;this.accessKeySecret = accessKeySecret;this.sessionToken = sessionToken;this.roleSessionDurationSeconds = roleSessionDurationSeconds;this.sessionStartedTimeInMilliSeconds = System.currentTimeMillis();}

// Translation:
public BasicSessionCredentials(string accessKeyId, string accessKeySecret,string sessionToken, long roleSessionDurationSeconds = 0){if (accessKeyId == null){throw new ArgumentOutOfRangeException("Access key ID cannot be null.");}if (accessKeySecret == null){throw new ArgumentOutOfRangeException("Access key secret cannot be null.");}this.accessKeyId = accessKeyId;this.accessKeySecret = accessKeySecret;this.sessionToken = sessionToken;this.roleSessionDurationSeconds = roleSessionDurationSeconds;sessionStartedTimeInMilliSeconds = DateTime.UtcNow.currentTimeMillis();}
// Original:
public final ShortBuffer get(short[] dst, int dstOffset, int shortCount) {if (shortCount > remaining()) {throw new BufferUnderflowException();}System.arraycopy(backingArray, offset + position, dst, dstOffset, shortCount);position += shortCount;return this;}

// Translation:
public sealed override java.nio.ShortBuffer get(short[] dst, int dstOffset, int shortCount){if (shortCount > remaining()){throw new java.nio.BufferUnderflowException();}System.Array.Copy(backingArray, offset + _position, dst, dstOffset, shortCount);_position += shortCount;return this;}
// Original:
public ActivateEventSourceResult activateEventSource(ActivateEventSourceRequest request) {request = beforeClientExecution(request);return executeActivateEventSource(request);}

// Translation:
public virtual ActivateEventSourceResponse ActivateEventSource(ActivateEventSourceRequest request){var options = new InvokeOptions();options.RequestMarshaller = ActivateEventSourceRequestMarshaller.Instance;options.ResponseUnmarshaller = ActivateEventSourceResponseUnmarshaller.Instance;return Invoke<ActivateEventSourceResponse>(request, options);}
// Original:
public DescribeReceiptRuleSetResult describeReceiptRuleSet(DescribeReceiptRuleSetRequest request) {request = beforeClientExecution(request);return executeDescribeReceiptRuleSet(request);}

// Translation:
public virtual DescribeReceiptRuleSetResponse DescribeReceiptRuleSet(DescribeReceiptRuleSetRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeReceiptRuleSetRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeReceiptRuleSetResponseUnmarshaller.Instance;return Invoke<DescribeReceiptRuleSetResponse>(request, options);}
// Original:
public Filter(String name) {setName(name);}

// Translation:
public Filter(string name){_name = name;}
// Original:
public DoubleBuffer put(double c) {throw new ReadOnlyBufferException();}

// Translation:
public override java.nio.DoubleBuffer put(double c){throw new java.nio.ReadOnlyBufferException();}
// Original:
public CreateTrafficPolicyInstanceResult createTrafficPolicyInstance(CreateTrafficPolicyInstanceRequest request) {request = beforeClientExecution(request);return executeCreateTrafficPolicyInstance(request);}

// Translation:
public virtual CreateTrafficPolicyInstanceResponse CreateTrafficPolicyInstance(CreateTrafficPolicyInstanceRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateTrafficPolicyInstanceRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateTrafficPolicyInstanceResponseUnmarshaller.Instance;return Invoke<CreateTrafficPolicyInstanceResponse>(request, options);}
// Original:
public JapaneseIterationMarkCharFilter(Reader input, boolean normalizeKanji, boolean normalizeKana) {super(input);this.normalizeKanji = normalizeKanji;this.normalizeKana = normalizeKana;buffer.reset(input);}

// Translation:
public JapaneseIterationMarkCharFilter(TextReader input, bool normalizeKanji, bool normalizeKana): base(input){this.normalizeKanji = normalizeKanji;this.normalizeKana = normalizeKana;buffer.Reset(input);}
// Original:
public void writeLong(long v) {writeInt((int)(v >>  0));writeInt((int)(v >> 32));}

// Translation:
public void WriteLong(long v){WriteInt((int)(v >> 0));WriteInt((int)(v >> 32));}
// Original:
public FileResolver() {exports = new ConcurrentHashMap<>();exportBase = new CopyOnWriteArrayList<>();}

// Translation:
public FileResolver(){exports = new ConcurrentHashMap<string, Repository>();exportBase = new CopyOnWriteArrayList<FilePath>();}
// Original:
public ValueEval getRef3DEval(Ref3DPxg rptg) {SheetRangeEvaluator sre = createExternSheetRefEvaluator(rptg.getSheetName(), rptg.getLastSheetName(), rptg.getExternalWorkbookNumber());return new LazyRefEval(rptg.getRow(), rptg.getColumn(), sre);}

// Translation:
public ValueEval GetRef3DEval(Ref3DPtg rptg){SheetRangeEvaluator sre = CreateExternSheetRefEvaluator(rptg.ExternSheetIndex);return new LazyRefEval(rptg.Row, rptg.Column, sre);}
// Original:
public DeleteDatasetResult deleteDataset(DeleteDatasetRequest request) {request = beforeClientExecution(request);return executeDeleteDataset(request);}

// Translation:
public virtual DeleteDatasetResponse DeleteDataset(DeleteDatasetRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteDatasetRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteDatasetResponseUnmarshaller.Instance;return Invoke<DeleteDatasetResponse>(request, options);}
// Original:
public StartRelationalDatabaseResult startRelationalDatabase(StartRelationalDatabaseRequest request) {request = beforeClientExecution(request);return executeStartRelationalDatabase(request);}

// Translation:
public virtual StartRelationalDatabaseResponse StartRelationalDatabase(StartRelationalDatabaseRequest request){var options = new InvokeOptions();options.RequestMarshaller = StartRelationalDatabaseRequestMarshaller.Instance;options.ResponseUnmarshaller = StartRelationalDatabaseResponseUnmarshaller.Instance;return Invoke<StartRelationalDatabaseResponse>(request, options);}
// Original:
public DescribeReservedCacheNodesOfferingsResult describeReservedCacheNodesOfferings() {return describeReservedCacheNodesOfferings(new DescribeReservedCacheNodesOfferingsRequest());}

// Translation:
public virtual DescribeReservedCacheNodesOfferingsResponse DescribeReservedCacheNodesOfferings(){return DescribeReservedCacheNodesOfferings(new DescribeReservedCacheNodesOfferingsRequest());}
// Original:
static public double pmt(double r, int nper, double pv, double fv, int type) {return -r * (pv * Math.pow(1 + r, nper) + fv) / ((1 + r*type) * (Math.pow(1 + r, nper) - 1));}

// Translation:
static public double PMT(double r, int nper, double pv, double fv, int type){double pmt = -r * (pv * Math.Pow(1 + r, nper) + fv) / ((1 + r * type) * (Math.Pow(1 + r, nper) - 1));return pmt;}
// Original:
public DescribeDocumentVersionsResult describeDocumentVersions(DescribeDocumentVersionsRequest request) {request = beforeClientExecution(request);return executeDescribeDocumentVersions(request);}

// Translation:
public virtual DescribeDocumentVersionsResponse DescribeDocumentVersions(DescribeDocumentVersionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeDocumentVersionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeDocumentVersionsResponseUnmarshaller.Instance;return Invoke<DescribeDocumentVersionsResponse>(request, options);}
// Original:
public ListPublishingDestinationsResult listPublishingDestinations(ListPublishingDestinationsRequest request) {request = beforeClientExecution(request);return executeListPublishingDestinations(request);}

// Translation:
public virtual ListPublishingDestinationsResponse ListPublishingDestinations(ListPublishingDestinationsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListPublishingDestinationsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListPublishingDestinationsResponseUnmarshaller.Instance;return Invoke<ListPublishingDestinationsResponse>(request, options);}
// Original:
public DeleteAccountAliasRequest(String accountAlias) {setAccountAlias(accountAlias);}

// Translation:
public DeleteAccountAliasRequest(string accountAlias){_accountAlias = accountAlias;}
// Original:
public static long[] grow(long[] array) {return grow(array, 1 + array.length);}

// Translation:
public static float[] Grow(float[] array){return Grow(array, 1 + array.Length);}
// Original:
public String outputToString(Object output) {if (!(output instanceof List)) {return outputs.outputToString((T) output);} else {List<T> outputList = (List<T>) output;StringBuilder b = new StringBuilder();b.append('[');for(int i=0;i<outputList.size();i++) {if (i > 0) {b.append(", ");}b.append(outputs.outputToString(outputList.get(i)));}b.append(']');return b.toString();}}

// Translation:
public override string OutputToString(object output){if (!(output is IList)){return outputs.OutputToString((T)output);}else{IList outputList = (IList)output;StringBuilder b = new StringBuilder();b.Append('[');for (int i = 0; i < outputList.Count; i++){if (i > 0){b.Append(", ");}b.Append(outputs.OutputToString((T)outputList[i]));}b.Append(']');return b.ToString();}}
// Original:
public void notifyDeleteCell(Cell cell) {_bookEvaluator.notifyDeleteCell(new HSSFEvaluationCell((HSSFCell)cell));}

// Translation:
public void NotifyDeleteCell(ICell cell){_bookEvaluator.NotifyDeleteCell(new HSSFEvaluationCell(cell));}
// Original:
public StringBuilder replace(int start, int end, String str) {replace0(start, end, str);return this;}

// Translation:
public java.lang.StringBuilder replace(int start, int end, string str){replace0(start, end, str);return this;}
// Original:
public SetIdentityPoolConfigurationResult setIdentityPoolConfiguration(SetIdentityPoolConfigurationRequest request) {request = beforeClientExecution(request);return executeSetIdentityPoolConfiguration(request);}

// Translation:
public virtual SetIdentityPoolConfigurationResponse SetIdentityPoolConfiguration(SetIdentityPoolConfigurationRequest request){var options = new InvokeOptions();options.RequestMarshaller = SetIdentityPoolConfigurationRequestMarshaller.Instance;options.ResponseUnmarshaller = SetIdentityPoolConfigurationResponseUnmarshaller.Instance;return Invoke<SetIdentityPoolConfigurationResponse>(request, options);}
// Original:
public static double kthSmallest(double[] v, int k) {double r = Double.NaN;int index = k-1; if (v!=null && v.length > index && index >= 0) {Arrays.sort(v);r = v[index];}return r;}

// Translation:
public static double kthSmallest(double[] v, int k){double r = double.NaN;k--; if (v != null && v.Length > k && k >= 0){Array.Sort(v);r = v[k];}return r;}
// Original:
public void set(int index, long value) {final int o = index >>> 5;final int b = index & 31;final int shift = b << 1;blocks[o] = (blocks[o] & ~(3L << shift)) | (value << shift);}

// Translation:
public override void Set(int index, long value){int o = (int)((uint)index >> 5);int b = index & 31;int shift = b << 1;blocks[o] = (blocks[o] & ~(3L << shift)) | (value << shift);}
// Original:
public String toString() {if (getChildren() == null || getChildren().size() == 0)return "<boolean operation='and'/>";StringBuilder sb = new StringBuilder();sb.append("<boolean operation='and'>");for (QueryNode child : getChildren()) {sb.append("\n");sb.append(child.toString());}sb.append("\n</boolean>");return sb.toString();}

// Translation:
public override string ToString(){var children = GetChildren();if (children == null || children.Count == 0)return "<boolean operation='and'/>";StringBuilder sb = new StringBuilder();sb.Append("<boolean operation='and'>");foreach (IQueryNode child in children){sb.Append("\n");sb.Append(child.ToString());}sb.Append("\n</boolean>");return sb.ToString();}
// Original:
public int sumTokenSizes(int fromIx, int toIx) {int result = 0;for (int i=fromIx; i<toIx; i++) {result += _ptgs[i].getSize();}return result;}

// Translation:
public int SumTokenSizes(int fromIx, int toIx){int result = 0;for (int i = fromIx; i < toIx; i++){result += _ptgs[i].Size;}return result;}
// Original:
public void setReadonly(boolean readonly) {if ( this.readonly && !readonly ) throw new IllegalStateException("can't alter readonly IntervalSet");this.readonly = readonly;}

// Translation:
public virtual void SetReadonly(bool @readonly){if (this.@readonly && !@readonly){throw new InvalidOperationException("can't alter readonly IntervalSet");}this.@readonly = @readonly;}
// Original:
public final void clearConsumingCell(FormulaCellCacheEntry cce) {if(!_consumingCells.remove(cce)) {throw new IllegalStateException("Specified formula cell is not consumed by this cell");}}

// Translation:
public void ClearConsumingCell(FormulaCellCacheEntry cce){if (!_consumingCells.Remove(cce)){throw new InvalidOperationException("Specified formula cell is not consumed by this cell");}}
// Original:
@Override public List<E> subList(int start, int end) {synchronized (mutex) {return new SynchronizedRandomAccessList<E>(list.subList(start, end), mutex);}}

// Translation:
public override java.util.List<E> subList(int start, int end){lock (mutex){return new java.util.Collections.SynchronizedRandomAccessList<E>(list.subList(start, end), mutex);}}
// Original:
public FileHeader getFileHeader() {return file;}

// Translation:
public virtual FileHeader GetFileHeader(){return file;}
// Original:
public AttachLoadBalancersResult attachLoadBalancers(AttachLoadBalancersRequest request) {request = beforeClientExecution(request);return executeAttachLoadBalancers(request);}

// Translation:
public virtual AttachLoadBalancersResponse AttachLoadBalancers(AttachLoadBalancersRequest request){var options = new InvokeOptions();options.RequestMarshaller = AttachLoadBalancersRequestMarshaller.Instance;options.ResponseUnmarshaller = AttachLoadBalancersResponseUnmarshaller.Instance;return Invoke<AttachLoadBalancersResponse>(request, options);}
// Original:
public InitiateJobRequest(String accountId, String vaultName, JobParameters jobParameters) {setAccountId(accountId);setVaultName(vaultName);setJobParameters(jobParameters);}

// Translation:
public InitiateJobRequest(string accountId, string vaultName, JobParameters jobParameters){_accountId = accountId;_vaultName = vaultName;_jobParameters = jobParameters;}
// Original:
public String toString() {return "SPL";}

// Translation:
public override string ToString(){return "SPL";}
// Original:
public ReplaceableAttribute(String name, String value, Boolean replace) {setName(name);setValue(value);setReplace(replace);}

// Translation:
public ReplaceableAttribute(string name, string value, bool replace){_name = name;_value = value;_replace = replace;}
// Original:
public final void add(IndexableField field) {fields.add(field);}

// Translation:
public void Add(IIndexableField field){fields.Add(field);}
// Original:
public DeleteStackSetResult deleteStackSet(DeleteStackSetRequest request) {request = beforeClientExecution(request);return executeDeleteStackSet(request);}

// Translation:
public virtual DeleteStackSetResponse DeleteStackSet(DeleteStackSetRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteStackSetRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteStackSetResponseUnmarshaller.Instance;return Invoke<DeleteStackSetResponse>(request, options);}
// Original:
public GetRepoBuildRuleListRequest() {super("cr", "2016-06-07", "GetRepoBuildRuleList", "cr");setUriPattern("/repos/[RepoNamespace]/[RepoName]/rules");setMethod(MethodType.GET);}

// Translation:
public GetRepoBuildRuleListRequest(): base("cr", "2016-06-07", "GetRepoBuildRuleList", "cr", "openAPI"){UriPattern = "/repos/[RepoNamespace]/[RepoName]/rules";Method = MethodType.GET;}
// Original:
public SparseArray(int initialCapacity) {initialCapacity = ArrayUtils.idealIntArraySize(initialCapacity);mKeys = new int[initialCapacity];mValues = new Object[initialCapacity];mSize = 0;}

// Translation:
public SparseArray(int initialCapacity){initialCapacity = android.util.@internal.ArrayUtils.idealIntArraySize(initialCapacity);mKeys = new int[initialCapacity];mValues = new object[initialCapacity];mSize = 0;}
// Original:
public InvokeServiceRequest() {super("industry-brain", "2018-07-12", "InvokeService");setMethod(MethodType.POST);}

// Translation:
public InvokeServiceRequest(): base("industry-brain", "2018-07-12", "InvokeService"){Method = MethodType.POST;}
// Original:
public ListAlbumPhotosRequest() {super("CloudPhoto", "2017-07-11", "ListAlbumPhotos", "cloudphoto");setProtocol(ProtocolType.HTTPS);}

// Translation:
public ListAlbumPhotosRequest(): base("CloudPhoto", "2017-07-11", "ListAlbumPhotos", "cloudphoto", "openAPI"){Protocol = ProtocolType.HTTPS;}
// Original:
public boolean hasPrevious() {return link != list.voidLink;}

// Translation:
public bool hasPrevious(){return link != list.voidLink;}
// Original:
public DeleteHsmConfigurationResult deleteHsmConfiguration(DeleteHsmConfigurationRequest request) {request = beforeClientExecution(request);return executeDeleteHsmConfiguration(request);}

// Translation:
public virtual DeleteHsmConfigurationResponse DeleteHsmConfiguration(DeleteHsmConfigurationRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteHsmConfigurationRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteHsmConfigurationResponseUnmarshaller.Instance;return Invoke<DeleteHsmConfigurationResponse>(request, options);}
// Original:
public CreateLoadBalancerRequest(String loadBalancerName) {setLoadBalancerName(loadBalancerName);}

// Translation:
public CreateLoadBalancerRequest(string loadBalancerName){_loadBalancerName = loadBalancerName;}
// Original:
public String getUserInfo() {return decode(userInfo);}

// Translation:
public string getUserInfo(){return decode(userInfo);}
// Original:
public TagAttendeeResult tagAttendee(TagAttendeeRequest request) {request = beforeClientExecution(request);return executeTagAttendee(request);}

// Translation:
public virtual TagAttendeeResponse TagAttendee(TagAttendeeRequest request){var options = new InvokeOptions();options.RequestMarshaller = TagAttendeeRequestMarshaller.Instance;options.ResponseUnmarshaller = TagAttendeeResponseUnmarshaller.Instance;return Invoke<TagAttendeeResponse>(request, options);}
// Original:
public String getRefName() {return name;}

// Translation:
public virtual string GetRefName(){return name;}
// Original:
public SpanNearQuery build() {return new SpanNearQuery(clauses.toArray(new SpanQuery[clauses.size()]), slop, ordered);}

// Translation:
public override WAH8DocIdSet Build(){if (this.wordNum != -1){AddWord(wordNum, (byte)word);}return base.Build();}
// Original:
public boolean isSubTotal(int rowIndex, int columnIndex) {return false;}

// Translation:
public virtual bool IsSubTotal(int rowIndex, int columnIndex){return false;}
// Original:
public DescribeDBProxiesResult describeDBProxies(DescribeDBProxiesRequest request) {request = beforeClientExecution(request);return executeDescribeDBProxies(request);}

// Translation:
public virtual DescribeDBProxiesResponse DescribeDBProxies(DescribeDBProxiesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeDBProxiesRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeDBProxiesResponseUnmarshaller.Instance;return Invoke<DescribeDBProxiesResponse>(request, options);}
// Original:
public GetVoiceConnectorProxyResult getVoiceConnectorProxy(GetVoiceConnectorProxyRequest request) {request = beforeClientExecution(request);return executeGetVoiceConnectorProxy(request);}

// Translation:
public virtual GetVoiceConnectorProxyResponse GetVoiceConnectorProxy(GetVoiceConnectorProxyRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetVoiceConnectorProxyRequestMarshaller.Instance;options.ResponseUnmarshaller = GetVoiceConnectorProxyResponseUnmarshaller.Instance;return Invoke<GetVoiceConnectorProxyResponse>(request, options);}