yijunyu/c-to-rust huggingface dataset:
// Original:
public boolean isAllowNonFastForwards() {return allowNonFastForwards;}

// Translation:
public virtual bool IsAllowNonFastForwards(){return allowNonFastForwards;}
// Original:
public FeatRecord() {futureHeader = new FtrHeader();futureHeader.setRecordType(sid);}

// Translation:
public FeatRecord(){futureHeader = new FtrHeader();futureHeader.RecordType = (sid);}
// Original:
public ShortBuffer put(short c) {throw new ReadOnlyBufferException();}

// Translation:
public override java.nio.ShortBuffer put(short c){throw new java.nio.ReadOnlyBufferException();}
// Original:
public void setQuery(CharSequence query) {this.query = query;this.message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, "");}

// Translation:
public virtual void SetQuery(string query){this.query = query;this.m_message = new Message(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, "");}
// Original:
public StashApplyCommand stashApply() {return new StashApplyCommand(repo);}

// Translation:
public virtual StashApplyCommand StashApply(){return new StashApplyCommand(repo);}
// Original:
public Set<String> nameSet() {return Collections.unmodifiableSet(dictionary.values());}

// Translation:
public ICollection NameSet(){return dictionaryNameToID.Keys;}
// Original:
public static int getEffectivePort(String scheme, int specifiedPort) {if (specifiedPort != -1) {return specifiedPort;}if ("http".equalsIgnoreCase(scheme)) {return 80;} else if ("https".equalsIgnoreCase(scheme)) {return 443;} else {return -1;}}

// Translation:
public static int getEffectivePort(string scheme, int specifiedPort){if (specifiedPort != -1){return specifiedPort;}if (Sharpen.StringHelper.EqualsIgnoreCase("http", scheme)){return 80;}else{if (Sharpen.StringHelper.EqualsIgnoreCase("https", scheme)){return 443;}else{return -1;}}}
// Original:
public ListAssessmentTemplatesResult listAssessmentTemplates(ListAssessmentTemplatesRequest request) {request = beforeClientExecution(request);return executeListAssessmentTemplates(request);}

// Translation:
public virtual ListAssessmentTemplatesResponse ListAssessmentTemplates(ListAssessmentTemplatesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListAssessmentTemplatesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListAssessmentTemplatesResponseUnmarshaller.Instance;return Invoke<ListAssessmentTemplatesResponse>(request, options);}
// Original:
public Cluster restoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request) {request = beforeClientExecution(request);return executeRestoreFromClusterSnapshot(request);}

// Translation:
public virtual RestoreFromClusterSnapshotResponse RestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = RestoreFromClusterSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.Instance;return Invoke<RestoreFromClusterSnapshotResponse>(request, options);}
// Original:
public void addShape(HSSFShape shape) {shape.setPatriarch(this.getPatriarch());shape.setParent(this);shapes.add(shape);}

// Translation:
public void AddShape(HSSFShape shape){shape.Patriarch = (this.Patriarch);shape.Parent = (this);shapes.Add(shape);}
// Original:
public boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;FacetEntry that = (FacetEntry) o;if (count != that.count) return false;if (!value.equals(that.value)) return false;return true;}

// Translation:
public override bool Equals(object o){if (this == o) return true;if (o == null || GetType() != o.GetType()) return false;FacetEntry that = (FacetEntry)o;if (count != that.count) return false;if (!value.Equals(that.value)) return false;return true;}
// Original:
public static final int prev(byte[] b, int ptr, char chrA) {if (ptr == b.length)--ptr;while (ptr >= 0) {if (b[ptr--] == chrA)return ptr;}return ptr;}

// Translation:
public static int Prev(byte[] b, int ptr, char chrA){if (ptr == b.Length){--ptr;}while (ptr >= 0){if (b[ptr--] == chrA){return ptr;}}return ptr;}
// Original:
public final boolean isDeltaRepresentation() {return deltaBase != null;}

// Translation:
public virtual bool IsDeltaRepresentation(){return deltaBase != null;}
// Original:
public Token emitEOF() {int cpos = getCharPositionInLine();int line = getLine();Token eof = _factory.create(_tokenFactorySourcePair, Token.EOF, null, Token.DEFAULT_CHANNEL, _input.index(), _input.index()-1,line, cpos);emit(eof);return eof;}

// Translation:
public virtual IToken EmitEOF(){int cpos = Column;int line = Line;IToken eof = _factory.Create(_tokenFactorySourcePair, TokenConstants.EOF, null, TokenConstants.DefaultChannel, _input.Index, _input.Index - 1, line, cpos);Emit(eof);return eof;}
// Original:
public UpdateUserRequest(String userName) {setUserName(userName);}

// Translation:
public UpdateUserRequest(string userName){_userName = userName;}
// Original:
public RevFilter negate() {return NotRevFilter.create(this);}

// Translation:
public virtual RevFilter Negate(){return NotRevFilter.Create(this);}
// Original:
public void setTagger(PersonIdent taggerIdent) {tagger = taggerIdent;}

// Translation:
public virtual void SetTagger(PersonIdent taggerIdent){tagger = taggerIdent;}
// Original:
public static BufferSize automatic() {Runtime rt = Runtime.getRuntime();final long max = rt.maxMemory(); final long total = rt.totalMemory(); final long free = rt.freeMemory(); final long totalAvailableBytes = max - total + free;long sortBufferByteSize = free/2;final long minBufferSizeBytes = MIN_BUFFER_SIZE_MB*MB;if (sortBufferByteSize <  minBufferSizeBytes|| totalAvailableBytes > 10 * minBufferSizeBytes) { if (totalAvailableBytes/2 > minBufferSizeBytes) { sortBufferByteSize = totalAvailableBytes/2; } else {sortBufferByteSize = Math.max(ABSOLUTE_MIN_SORT_BUFFER_SIZE, sortBufferByteSize);}}return new BufferSize(Math.min((long)Integer.MAX_VALUE, sortBufferByteSize));}

// Translation:
public static BufferSize Automatic(){long max, total, free;using (var proc = Process.GetCurrentProcess()){max = proc.PeakVirtualMemorySize64; total = proc.VirtualMemorySize64; free = proc.PrivateMemorySize64; }long totalAvailableBytes = max - total + free;long sortBufferByteSize = free / 2;long minBufferSizeBytes = MIN_BUFFER_SIZE_MB * MB;if (sortBufferByteSize < minBufferSizeBytes || totalAvailableBytes > 10 * minBufferSizeBytes) {if (totalAvailableBytes / 2 > minBufferSizeBytes) {sortBufferByteSize = totalAvailableBytes / 2; }else{sortBufferByteSize = Math.Max(ABSOLUTE_MIN_SORT_BUFFER_SIZE, sortBufferByteSize);}}return new BufferSize(Math.Min((long)int.MaxValue, sortBufferByteSize));}
// Original:
public static int trimTrailingWhitespace(byte[] raw, int start, int end) {int ptr = end - 1;while (start <= ptr && isWhitespace(raw[ptr]))ptr--;return ptr + 1;}

// Translation:
public static int TrimTrailingWhitespace(byte[] raw, int start, int end){int ptr = end - 1;while (start <= ptr && IsWhitespace(raw[ptr])){ptr--;}return ptr + 1;}
// Original:
public TopMarginRecord( RecordInputStream in ) {field_1_margin = in.readDouble();}

// Translation:
public TopMarginRecord(RecordInputStream in1){field_1_margin = in1.ReadDouble();}
// Original:
public RetrieveEnvironmentInfoRequest(EnvironmentInfoType infoType) {setInfoType(infoType.toString());}

// Translation:
public RetrieveEnvironmentInfoRequest(EnvironmentInfoType infoType){_infoType = infoType;}
// Original:
public CreatePlayerSessionsResult createPlayerSessions(CreatePlayerSessionsRequest request) {request = beforeClientExecution(request);return executeCreatePlayerSessions(request);}

// Translation:
public virtual CreatePlayerSessionsResponse CreatePlayerSessions(CreatePlayerSessionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreatePlayerSessionsRequestMarshaller.Instance;options.ResponseUnmarshaller = CreatePlayerSessionsResponseUnmarshaller.Instance;return Invoke<CreatePlayerSessionsResponse>(request, options);}
// Original:
public CreateProxySessionResult createProxySession(CreateProxySessionRequest request) {request = beforeClientExecution(request);return executeCreateProxySession(request);}

// Translation:
public virtual CreateProxySessionResponse CreateProxySession(CreateProxySessionRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateProxySessionRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateProxySessionResponseUnmarshaller.Instance;return Invoke<CreateProxySessionResponse>(request, options);}
// Original:
public int getObjectType() {return type;}

// Translation:
public virtual int GetObjectType(){return type;}
// Original:
public String getScheme() {return scheme;}

// Translation:
public virtual string GetScheme(){return scheme;}
// Original:
public void characters(char[] ch, int start, int length) {contents.append(ch, start, length);}

// Translation:
public override void Characters(char[] ch, int start, int length){contents.Append(ch, start, length);}
// Original:
public FetchAlbumTagPhotosRequest() {super("CloudPhoto", "2017-07-11", "FetchAlbumTagPhotos", "cloudphoto");setProtocol(ProtocolType.HTTPS);}

// Translation:
public FetchAlbumTagPhotosRequest(): base("CloudPhoto", "2017-07-11", "FetchAlbumTagPhotos", "cloudphoto", "openAPI"){Protocol = ProtocolType.HTTPS;}
// Original:
public DeleteMembersResult deleteMembers(DeleteMembersRequest request) {request = beforeClientExecution(request);return executeDeleteMembers(request);}

// Translation:
public virtual DeleteMembersResponse DeleteMembers(DeleteMembersRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteMembersRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteMembersResponseUnmarshaller.Instance;return Invoke<DeleteMembersResponse>(request, options);}
// Original:
public GetContactReachabilityStatusResult getContactReachabilityStatus(GetContactReachabilityStatusRequest request) {request = beforeClientExecution(request);return executeGetContactReachabilityStatus(request);}

// Translation:
public virtual GetContactReachabilityStatusResponse GetContactReachabilityStatus(GetContactReachabilityStatusRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetContactReachabilityStatusRequestMarshaller.Instance;options.ResponseUnmarshaller = GetContactReachabilityStatusResponseUnmarshaller.Instance;return Invoke<GetContactReachabilityStatusResponse>(request, options);}
// Original:
@Override public boolean remove(Object o) {return Impl.this.remove(o) != null;}

// 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 E last() {return backingMap.lastKey();}

// Translation:
public virtual E last(){return backingMap.lastKey();}
// Original:
public CreateStreamingDistributionResult createStreamingDistribution(CreateStreamingDistributionRequest request) {request = beforeClientExecution(request);return executeCreateStreamingDistribution(request);}

// Translation:
public virtual CreateStreamingDistributionResponse CreateStreamingDistribution(CreateStreamingDistributionRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateStreamingDistributionRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateStreamingDistributionResponseUnmarshaller.Instance;return Invoke<CreateStreamingDistributionResponse>(request, options);}
// Original:
public boolean isAbsolute() {return absolute;}

// Translation:
public bool isAbsolute(){return absolute;}
// Original:
public DisableAddOnResult disableAddOn(DisableAddOnRequest request) {request = beforeClientExecution(request);return executeDisableAddOn(request);}

// Translation:
public virtual DisableAddOnResponse DisableAddOn(DisableAddOnRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisableAddOnRequestMarshaller.Instance;options.ResponseUnmarshaller = DisableAddOnResponseUnmarshaller.Instance;return Invoke<DisableAddOnResponse>(request, options);}
// Original:
public DescribeAliasResult describeAlias(DescribeAliasRequest request) {request = beforeClientExecution(request);return executeDescribeAlias(request);}

// Translation:
public virtual DescribeAliasResponse DescribeAlias(DescribeAliasRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeAliasRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeAliasResponseUnmarshaller.Instance;return Invoke<DescribeAliasResponse>(request, options);}
// Original:
public void next(int delta) {while (--delta >= 0) {if (currentSubtree != null)ptr += currentSubtree.getEntrySpan();elseptr++;if (eof())break;parseEntry();}}

// Translation:
public override void Next(int delta){while (--delta >= 0){if (currentSubtree != null){ptr += currentSubtree.GetEntrySpan();}else{ptr++;}if (Eof){break;}ParseEntry();}}
// Original:
public RevFilter clone() {return new Binary(a.clone(), b.clone());}

// Translation:
public override RevFilter Clone(){return new AndRevFilter.Binary(a.Clone(), b.Clone());}
// Original:
public Reader create(Reader input) {return new PersianCharFilter(input);}

// Translation:
public override TextReader Create(TextReader input){return new PersianCharFilter(input);}
// Original:
public String option() {return option;}

// Translation:
public virtual string Option(){return option;}
// Original:
public String toString() {final StringBuilder sb = new StringBuilder("[");for (Object item : this) {if (sb.length()>1) sb.append(", ");if (item instanceof char[]) {sb.append((char[]) item);} else {sb.append(item);}}return sb.append(']').toString();}

// Translation:
public override string ToString(){var sb = new StringBuilder("[");foreach (var item in this){if (sb.Length > 1){sb.Append(", ");}sb.Append(item);}return sb.Append(']').ToString();}
// Original:
public DescribeSignalingChannelResult describeSignalingChannel(DescribeSignalingChannelRequest request) {request = beforeClientExecution(request);return executeDescribeSignalingChannel(request);}

// Translation:
public virtual DescribeSignalingChannelResponse DescribeSignalingChannel(DescribeSignalingChannelRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeSignalingChannelRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeSignalingChannelResponseUnmarshaller.Instance;return Invoke<DescribeSignalingChannelResponse>(request, options);}
// Original:
public AttachStaticIpResult attachStaticIp(AttachStaticIpRequest request) {request = beforeClientExecution(request);return executeAttachStaticIp(request);}

// Translation:
public virtual AttachStaticIpResponse AttachStaticIp(AttachStaticIpRequest request){var options = new InvokeOptions();options.RequestMarshaller = AttachStaticIpRequestMarshaller.Instance;options.ResponseUnmarshaller = AttachStaticIpResponseUnmarshaller.Instance;return Invoke<AttachStaticIpResponse>(request, options);}
// Original:
public String toString() {StringBuilder sb = new StringBuilder(64);CellReference crA = new CellReference(_firstRowIndex, _firstColumnIndex, false, false);CellReference crB = new CellReference(_lastRowIndex, _lastColumnIndex, false, false);sb.append(getClass().getName());sb.append(" [").append(crA.formatAsString()).append(':').append(crB.formatAsString()).append("]");return sb.toString();}

// Translation:
public override String ToString(){StringBuilder sb = new StringBuilder(64);CellReference crA = new CellReference(_firstRowIndex, _firstColumnIndex, false, false);CellReference crB = new CellReference(_lastRowIndex, _lastColumnIndex, false, false);sb.Append(GetType().Name);sb.Append(" [").Append(crA.FormatAsString()).Append(':').Append(crB.FormatAsString()).Append("]");return sb.ToString();}
// Original:
public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat,BloomFilterFactory bloomFilterFactory) {super(BLOOM_CODEC_NAME);this.delegatePostingsFormat = delegatePostingsFormat;this.bloomFilterFactory = bloomFilterFactory;}

// Translation:
public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat,BloomFilterFactory bloomFilterFactory) : base(){_delegatePostingsFormat = delegatePostingsFormat;_bloomFilterFactory = bloomFilterFactory;}
// Original:
public ListTemplatesResult listTemplates(ListTemplatesRequest request) {request = beforeClientExecution(request);return executeListTemplates(request);}

// Translation:
public virtual ListTemplatesResponse ListTemplates(ListTemplatesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListTemplatesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListTemplatesResponseUnmarshaller.Instance;return Invoke<ListTemplatesResponse>(request, options);}
// Original:
public TimerThread(long resolution, Counter counter) {super(THREAD_NAME);this.resolution = resolution;this.counter = counter;this.setDaemon(true);}

// Translation:
public TimerThread(long resolution, Counter counter): base(THREAD_NAME){this.resolution = resolution;this.counter = counter;this.IsBackground = (true);}
// Original:
public DrawingRecord() {recordData = EMPTY_BYTE_ARRAY;}

// Translation:
public DrawingRecord(){recordData = EMPTY_BYTE_ARRAY;}
// Original:
public ListDirectoriesResult listDirectories(ListDirectoriesRequest request) {request = beforeClientExecution(request);return executeListDirectories(request);}

// Translation:
public virtual ListDirectoriesResponse ListDirectories(ListDirectoriesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListDirectoriesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListDirectoriesResponseUnmarshaller.Instance;return Invoke<ListDirectoriesResponse>(request, options);}
// Original:
public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {for (int j = 0; j < iterations; ++j) {final byte block = blocks[blocksOffset++];values[valuesOffset++] = (block >>> 7) & 1;values[valuesOffset++] = (block >>> 6) & 1;values[valuesOffset++] = (block >>> 5) & 1;values[valuesOffset++] = (block >>> 4) & 1;values[valuesOffset++] = (block >>> 3) & 1;values[valuesOffset++] = (block >>> 2) & 1;values[valuesOffset++] = (block >>> 1) & 1;values[valuesOffset++] = block & 1;}}

// Translation:
public override void Decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations){for (int j = 0; j < iterations; ++j){var block = blocks[blocksOffset++];values[valuesOffset++] = ((int)((uint)block >> 7)) & 1;values[valuesOffset++] = ((int)((uint)block >> 6)) & 1;values[valuesOffset++] = ((int)((uint)block >> 5)) & 1;values[valuesOffset++] = ((int)((uint)block >> 4)) & 1;values[valuesOffset++] = ((int)((uint)block >> 3)) & 1;values[valuesOffset++] = ((int)((uint)block >> 2)) & 1;values[valuesOffset++] = ((int)((uint)block >> 1)) & 1;values[valuesOffset++] = block & 1;}}
// Original:
public GroupingSearch disableCaching() {this.maxCacheRAMMB = null;this.maxDocsToCache = null;return this;}

// Translation:
public virtual GroupingSearch DisableCaching(){this.maxCacheRAMMB = null;this.maxDocsToCache = null;return this;}
// Original:
public static int idealByteArraySize(int need) {for (int i = 4; i < 32; i++)if (need <= (1 << i) - 12)return (1 << i) - 12;return need;}

// Translation:
public static int idealByteArraySize(int need){{for (int i = 4; i < 32; i++){if (need <= (1 << i) - 12){return (1 << i) - 12;}}}return need;}
// Original:
public UpdateAssessmentTargetResult updateAssessmentTarget(UpdateAssessmentTargetRequest request) {request = beforeClientExecution(request);return executeUpdateAssessmentTarget(request);}

// Translation:
public virtual UpdateAssessmentTargetResponse UpdateAssessmentTarget(UpdateAssessmentTargetRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateAssessmentTargetRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateAssessmentTargetResponseUnmarshaller.Instance;return Invoke<UpdateAssessmentTargetResponse>(request, options);}
// Original:
public ModifyVolumeResult modifyVolume(ModifyVolumeRequest request) {request = beforeClientExecution(request);return executeModifyVolume(request);}

// Translation:
public virtual ModifyVolumeResponse ModifyVolume(ModifyVolumeRequest request){var options = new InvokeOptions();options.RequestMarshaller = ModifyVolumeRequestMarshaller.Instance;options.ResponseUnmarshaller = ModifyVolumeResponseUnmarshaller.Instance;return Invoke<ModifyVolumeResponse>(request, options);}
// Original:
public Cell merge(Cell m, Cell e) {if (m.cmd == e.cmd && m.ref == e.ref && m.skip == e.skip) {Cell c = new Cell(m);c.cnt += e.cnt;return c;} else {return null;}}

// Translation:
public override Cell Merge(Cell m, Cell e){if (m.cmd == e.cmd && m.@ref == e.@ref && m.skip == e.skip) {Cell c = new Cell(m);c.cnt += e.cnt;return c;} else {return null;}}
// Original:
public ByteBuffer read(int length, long position) throws IOException {if(position >= size()) {throw new IndexOutOfBoundsException("Position " + position + " past the end of the file");}ByteBuffer dst;if (writable) {dst = channel.map(FileChannel.MapMode.READ_WRITE, position, length);buffersToClean.add(dst);} else {channel.position(position);dst = ByteBuffer.allocate(length);int worked = IOUtils.readFully(channel, dst);if(worked == -1) {throw new IndexOutOfBoundsException("Position " + position + " past the end of the file");}}dst.position(0);return dst;}

// Translation:
public override ByteBuffer Read(int length, long position){if (position >= Size)throw new ArgumentException("Position " + position + " past the end of the file");ByteBuffer dst;int worked = -1;if (writable){dst = ByteBuffer.CreateBuffer(length);worked = 0;}else{fileStream.Position = position;dst = ByteBuffer.CreateBuffer(length);worked = IOUtils.ReadFully(fileStream, dst.Buffer);}if(worked == -1)throw new ArgumentException("Position " + position + " past the end of the file");dst.Position = 0;return dst;}
// Original:
public void respondActivityTaskCompleted(RespondActivityTaskCompletedRequest request) {request = beforeClientExecution(request);executeRespondActivityTaskCompleted(request);}

// Translation:
public virtual RespondActivityTaskCompletedResponse RespondActivityTaskCompleted(RespondActivityTaskCompletedRequest request){var options = new InvokeOptions();options.RequestMarshaller = RespondActivityTaskCompletedRequestMarshaller.Instance;options.ResponseUnmarshaller = RespondActivityTaskCompletedResponseUnmarshaller.Instance;return Invoke<RespondActivityTaskCompletedResponse>(request, options);}
// Original:
public synchronized final void incrementProgressBy(int diff) {setProgress(mProgress + diff);}

// Translation:
public void incrementProgressBy(int diff){lock (this){setProgress(mProgress + diff);}}