yijunyu/c-to-rust huggingface dataset:
// Original:
public static File resolve(File directory, FS fs) {if (isGitRepository(directory, fs))return directory;if (isGitRepository(new File(directory, Constants.DOT_GIT), fs))return new File(directory, Constants.DOT_GIT);final String name = directory.getName();final File parent = directory.getParentFile();if (isGitRepository(new File(parent, name + Constants.DOT_GIT_EXT), fs))return new File(parent, name + Constants.DOT_GIT_EXT);return null;}

// Translation:
public static FilePath Resolve(FilePath directory, FS fs){if (IsGitRepository(directory, fs)){return directory;}if (IsGitRepository(new FilePath(directory, Constants.DOT_GIT), fs)){return new FilePath(directory, Constants.DOT_GIT);}string name = directory.GetName();FilePath parent = directory.GetParentFile();if (IsGitRepository(new FilePath(parent, name + Constants.DOT_GIT_EXT), fs)){return new FilePath(parent, name + Constants.DOT_GIT_EXT);}return null;}
// Original:
public WorkflowTypeInfos listWorkflowTypes(ListWorkflowTypesRequest request) {request = beforeClientExecution(request);return executeListWorkflowTypes(request);}

// Translation:
public virtual ListWorkflowTypesResponse ListWorkflowTypes(ListWorkflowTypesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListWorkflowTypesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListWorkflowTypesResponseUnmarshaller.Instance;return Invoke<ListWorkflowTypesResponse>(request, options);}
// Original:
public Snapshot copyClusterSnapshot(CopyClusterSnapshotRequest request) {request = beforeClientExecution(request);return executeCopyClusterSnapshot(request);}

// Translation:
public virtual CopyClusterSnapshotResponse CopyClusterSnapshot(CopyClusterSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = CopyClusterSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = CopyClusterSnapshotResponseUnmarshaller.Instance;return Invoke<CopyClusterSnapshotResponse>(request, options);}
// Original:
public Ptg[] getFormulaTokens(EvaluationCell evalCell) {HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell();FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord();return fra.getFormulaTokens();}

// Translation:
public Ptg[] GetFormulaTokens(IEvaluationCell evalCell){ICell cell = ((HSSFEvaluationCell)evalCell).HSSFCell;FormulaRecordAggregate fr = (FormulaRecordAggregate)((HSSFCell)cell).CellValueRecord;return fr.FormulaTokens;}
// Original:
public DisassociateVPCFromHostedZoneResult disassociateVPCFromHostedZone(DisassociateVPCFromHostedZoneRequest request) {request = beforeClientExecution(request);return executeDisassociateVPCFromHostedZone(request);}

// Translation:
public virtual DisassociateVPCFromHostedZoneResponse DisassociateVPCFromHostedZone(DisassociateVPCFromHostedZoneRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateVPCFromHostedZoneRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateVPCFromHostedZoneResponseUnmarshaller.Instance;return Invoke<DisassociateVPCFromHostedZoneResponse>(request, options);}
// Original:
public StringBuffer insert(int index, int i) {return insert(index, Integer.toString(i));}

// Translation:
public java.lang.StringBuffer insert(int index, int i){return insert(index, System.Convert.ToString(i));}
// Original:
public void setBytesValue(BytesRef value) {if (!(fieldsData instanceof BytesRef)) {throw new IllegalArgumentException("cannot change value type from " + fieldsData.getClass().getSimpleName() + " to BytesRef");}if (type.indexOptions() != IndexOptions.NONE) {throw new IllegalArgumentException("cannot set a BytesRef value on an indexed field");}if (value == null) {throw new IllegalArgumentException("value must not be null");}fieldsData = value;}

// Translation:
public virtual void SetBytesValue(BytesRef value){if (!(FieldsData is BytesRef)){throw new System.ArgumentException("cannot change value type from " + FieldsData.GetType().Name + " to BytesRef");}if (m_type.IsIndexed){throw new System.ArgumentException("cannot set a BytesRef value on an indexed field");}FieldsData = value;}
// Original:
public boolean equals( Object o ) {return o instanceof GermanStemmer;}

// Translation:
public override bool Equals(object o){return o is GermanStemmer;}
// Original:
public UntagMeetingResult untagMeeting(UntagMeetingRequest request) {request = beforeClientExecution(request);return executeUntagMeeting(request);}

// Translation:
public virtual UntagMeetingResponse UntagMeeting(UntagMeetingRequest request){var options = new InvokeOptions();options.RequestMarshaller = UntagMeetingRequestMarshaller.Instance;options.ResponseUnmarshaller = UntagMeetingResponseUnmarshaller.Instance;return Invoke<UntagMeetingResponse>(request, options);}
// Original:
public String toString() {return "[PRECISION]\n" +"    .precision       = " + getFullPrecision() +"\n" +"[/PRECISION]\n";}

// Translation:
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[PRECISION]\n");buffer.Append("    .precision       = ").Append(FullPrecision).Append("\n");buffer.Append("[/PRECISION]\n");return buffer.ToString();}
// Original:
static public double pmt(double r, int nper, double pv, double fv) {return pmt(r, nper, pv, fv, 0);}

// Translation:
static public double PMT(double r, int nper, double pv, double fv){return PMT(r, nper, pv, fv, 0);}
// Original:
public ValueEval getArea3DEval(Area3DPxg aptg) {SheetRangeEvaluator sre = createExternSheetRefEvaluator(aptg.getSheetName(), aptg.getLastSheetName(), aptg.getExternalWorkbookNumber());return new LazyAreaEval(aptg.getFirstRow(), aptg.getFirstColumn(),aptg.getLastRow(), aptg.getLastColumn(), sre);}

// Translation:
public ValueEval GetArea3DEval(Area3DPtg aptg){SheetRangeEvaluator sre = CreateExternSheetRefEvaluator(aptg.ExternSheetIndex);return new LazyAreaEval(aptg.FirstRow, aptg.FirstColumn,aptg.LastRow, aptg.LastColumn, sre);}
// Original:
public boolean equals(Object obj) {if (obj instanceof Rect) {Rect rhs = (Rect) obj;if (isValid() != rhs.isValid()) {return false;}if (!isValid() && !rhs.isValid()) {return true;}return this.x == rhs.x && this.y == rhs.y && this.w == rhs.w && this.h == rhs.h;}return false;}

// Translation:
public override bool Equals(object obj){android.graphics.Rect r = (android.graphics.Rect)obj;if (r != null){return left == r.left && top == r.top && right == r.right && bottom == r.bottom;}return false;}
// Original:
public final boolean containsColumn(int col) {return _firstColumn <= col && _lastColumn >= col;}

// Translation:
public bool ContainsColumn(int col){return (_firstColumn <= col) && (_lastColumn >= col);}
// Original:
public RunJobFlowRequest(String name, JobFlowInstancesConfig instances) {setName(name);setInstances(instances);}

// Translation:
public RunJobFlowRequest(string name, JobFlowInstancesConfig instances){_name = name;_instances = instances;}
// Original:
public String toString() {if (noBreak == null && postBreak == null && preBreak != null&& preBreak.equals("-")) {return "-";}StringBuilder res = new StringBuilder("{");res.append(preBreak);res.append("}{");res.append(postBreak);res.append("}{");res.append(noBreak);res.append('}');return res.toString();}

// Translation:
public override string ToString(){if (NoBreak == null && PostBreak == null && PreBreak != null && PreBreak.Equals("-", StringComparison.Ordinal)){return "-";}StringBuilder res = new StringBuilder("{");res.Append(PreBreak);res.Append("}{");res.Append(PostBreak);res.Append("}{");res.Append(NoBreak);res.Append('}');return res.ToString();}
// Original:
public ListPublishedSchemaArnsResult listPublishedSchemaArns(ListPublishedSchemaArnsRequest request) {request = beforeClientExecution(request);return executeListPublishedSchemaArns(request);}

// Translation:
public virtual ListPublishedSchemaArnsResponse ListPublishedSchemaArns(ListPublishedSchemaArnsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListPublishedSchemaArnsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListPublishedSchemaArnsResponseUnmarshaller.Instance;return Invoke<ListPublishedSchemaArnsResponse>(request, options);}
// Original:
public StoredField(String name, double value) {super(name, TYPE);fieldsData = value;}

// Translation:
public StoredField(string name, float value): base(name, TYPE){FieldsData = new Single(value);}
// Original:
public DescribeNetworkAclsResult describeNetworkAcls() {return describeNetworkAcls(new DescribeNetworkAclsRequest());}

// Translation:
public virtual DescribeNetworkAclsResponse DescribeNetworkAcls(){return DescribeNetworkAcls(new DescribeNetworkAclsRequest());}
// Original:
public PushCommand add(Ref ref) {refSpecs.add(new RefSpec(ref.getLeaf().getName()));return this;}

// Translation:
public virtual NGit.Api.PushCommand Add(Ref @ref){refSpecs.AddItem(new RefSpec(@ref.GetLeaf().GetName()));return this;}
// Original:
public DeleteVoiceConnectorGroupResult deleteVoiceConnectorGroup(DeleteVoiceConnectorGroupRequest request) {request = beforeClientExecution(request);return executeDeleteVoiceConnectorGroup(request);}

// Translation:
public virtual DeleteVoiceConnectorGroupResponse DeleteVoiceConnectorGroup(DeleteVoiceConnectorGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteVoiceConnectorGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteVoiceConnectorGroupResponseUnmarshaller.Instance;return Invoke<DeleteVoiceConnectorGroupResponse>(request, options);}
// Original:
public IntervalSet(List<Interval> intervals) {this.intervals = intervals;}

// Translation:
public IntervalSet(IList<Interval> intervals){this.intervals = intervals;}
// Original:
public IteratorQueue(Iterator<T> iter) {this.iter = iter;T removeTop = removeTop();assert removeTop == null;}

// Translation:
public IteratorQueue(IEnumerator<T> iter){this.iter = iter;T removeTop = RemoveTop();Debug.Assert( removeTop == null);}
// Original:
public static long[] grow(long[] array) {return grow(array, 1 + array.length);}

// Translation:
public static long[] Grow(long[] array){return Grow(array, 1 + array.Length);}
// Original:
public StemmerOverrideMap(FST<BytesRef> fst, boolean ignoreCase) {this.fst = fst;this.ignoreCase = ignoreCase;}

// Translation:
public StemmerOverrideMap(FST<BytesRef> fst, bool ignoreCase){this.fst = fst;this.ignoreCase = ignoreCase;}
// Original:
public DeleteAdmChannelResult deleteAdmChannel(DeleteAdmChannelRequest request) {request = beforeClientExecution(request);return executeDeleteAdmChannel(request);}

// Translation:
public virtual DeleteAdmChannelResponse DeleteAdmChannel(DeleteAdmChannelRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteAdmChannelRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteAdmChannelResponseUnmarshaller.Instance;return Invoke<DeleteAdmChannelResponse>(request, options);}
// Original:
public SetSubscriptionAttributesRequest(String subscriptionArn, String attributeName, String attributeValue) {setSubscriptionArn(subscriptionArn);setAttributeName(attributeName);setAttributeValue(attributeValue);}

// Translation:
public SetSubscriptionAttributesRequest(string subscriptionArn, string attributeName, string attributeValue){_subscriptionArn = subscriptionArn;_attributeName = attributeName;_attributeValue = attributeValue;}
// Original:
public void unsafeWrite(char b) {buf[len++] = b;}

// Translation:
public virtual void UnsafeWrite(char b){m_buf[m_len++] = b;}
// Original:
@Override public boolean remove(Object key) {int count = 0;Collection<V> collection = subMap.remove(key);if (collection != null) {count = collection.size();collection.clear();totalSize -= count;}return count > 0;}

// Translation:
public override bool remove(object o){lock (this._enclosing){int oldSize = this._enclosing._size;this._enclosing.remove(o);return this._enclosing._size != oldSize;}}
// Original:
public boolean markSupported() {return false;}

// Translation:
public virtual bool markSupported(){return false;}