yijunyu/c-to-rust huggingface dataset:
// Original:
public ListSmartHomeAppliancesResult listSmartHomeAppliances(ListSmartHomeAppliancesRequest request) {request = beforeClientExecution(request);return executeListSmartHomeAppliances(request);}

// Translation:
public virtual ListSmartHomeAppliancesResponse ListSmartHomeAppliances(ListSmartHomeAppliancesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListSmartHomeAppliancesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListSmartHomeAppliancesResponseUnmarshaller.Instance;return Invoke<ListSmartHomeAppliancesResponse>(request, options);}
// Original:
public void dispatch(ConfigChangedListener listener) {listener.onConfigChanged(this);}

// Translation:
public override void Dispatch(ConfigChangedListener listener){listener.OnConfigChanged(this);}
// Original:
public File[] listFiles() {return filenamesToFiles(list());}

// Translation:
public java.io.File[] listFiles(){return filenamesToFiles(list());}
// Original:
public DedicatedCapacityInner getByResourceGroup(String resourceGroupName, String dedicatedCapacityName) {return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCapacityName).toBlocking().single().body();}

// Translation:
public async Task<AzureOperationResponse<DedicatedCapacity>> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)){return await innerCapacityOperations.GetDetailsWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false);}
// Original:
public void seekExact(long ord) {assert ord < info.terms.size();termUpto = (int) ord;info.terms.get(info.sortedTerms[termUpto], br);}

// Translation:
public override void SeekExact(long ord){Debug.Assert(ord < info.terms.Count);termUpto = (int)ord;}
// Original:
public CreateTrialComponentResult createTrialComponent(CreateTrialComponentRequest request) {request = beforeClientExecution(request);return executeCreateTrialComponent(request);}

// Translation:
public virtual CreateTrialComponentResponse CreateTrialComponent(CreateTrialComponentRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateTrialComponentRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateTrialComponentResponseUnmarshaller.Instance;return Invoke<CreateTrialComponentResponse>(request, options);}
// Original:
public UpdateResourceResult updateResource(UpdateResourceRequest request) {request = beforeClientExecution(request);return executeUpdateResource(request);}

// Translation:
public virtual UpdateResourceResponse UpdateResource(UpdateResourceRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateResourceRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateResourceResponseUnmarshaller.Instance;return Invoke<UpdateResourceResponse>(request, options);}
// Original:
public long length() {try {return channel.size();} catch (IOException ioe) {throw new RuntimeException("IOException during length(): " + this, ioe);}}

// Translation:
public long length(){try{return channel.size();}catch (IOException ioe){throw new Exception("IOException during length(): " + this, ioe);}}
// Original:
public char setIndex(int position) {if (position < getBeginIndex() || position > getEndIndex())throw new IllegalArgumentException("Illegal Position: " + position);index = start + position;return current();}

// Translation:
public override char SetIndex(int position){if (position < BeginIndex || position > EndIndex){throw new ArgumentException("Illegal Position: " + position);}index = start + position;return Current;}
// Original:
public static boolean isContainer(short options, short recordId){if(recordId >= EscherContainerRecord.DGG_CONTAINER &&  recordId<= EscherContainerRecord.SOLVER_CONTAINER){return true;} else {if (recordId == EscherTextboxRecord.RECORD_ID) {return false;} else {return ( options & (short) 0x000F ) == (short) 0x000F;}}}

// Translation:
public static bool IsContainer(short options, short recordId){if (recordId >= EscherContainerRecord.DGG_CONTAINER && recordId<= EscherContainerRecord.SOLVER_CONTAINER){return true;}else{if (recordId == EscherTextboxRecord.RECORD_ID){return false;}else{return (options & (short)0x000F) == (short)0x000F;}}}
// Original:
public boolean exists(String fileName) {assert locked();if (!refCounts.containsKey(fileName)) {return false;} else {return getRefCount(fileName).count > 0;}}

// Translation:
public bool Exists(string fileName){Debug.Assert(IsLocked);return refCounts.TryGetValue(fileName, out RefCount value) ? value.count > 0 : false;}
// Original:
public STSAssumeRoleSessionCredentialsProvider withSTSClient(IAcsClient client) {this.stsClient = client;return this;}

// Translation:
public void WithSTSClient(IAcsClient client){stsClient = client;}
// Original:
public AcceptMatchResult acceptMatch(AcceptMatchRequest request) {request = beforeClientExecution(request);return executeAcceptMatch(request);}

// Translation:
public virtual AcceptMatchResponse AcceptMatch(AcceptMatchRequest request){var options = new InvokeOptions();options.RequestMarshaller = AcceptMatchRequestMarshaller.Instance;options.ResponseUnmarshaller = AcceptMatchResponseUnmarshaller.Instance;return Invoke<AcceptMatchResponse>(request, options);}
// Original:
public static RevFilter create(int skip) {if (skip < 0)throw new IllegalArgumentException(JGitText.get().skipMustBeNonNegative);return new SkipRevFilter(skip);}

// Translation:
public static RevFilter Create(int skip){if (skip < 0){throw new ArgumentException(JGitText.Get().skipMustBeNonNegative);}return new NGit.Revwalk.Filter.SkipRevFilter(skip);}
// Original:
public GetHITResult getHIT(GetHITRequest request) {request = beforeClientExecution(request);return executeGetHIT(request);}

// Translation:
public virtual GetHITResponse GetHIT(GetHITRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetHITRequestMarshaller.Instance;options.ResponseUnmarshaller = GetHITResponseUnmarshaller.Instance;return Invoke<GetHITResponse>(request, options);}
// Original:
public StopStreamProcessorResult stopStreamProcessor(StopStreamProcessorRequest request) {request = beforeClientExecution(request);return executeStopStreamProcessor(request);}

// Translation:
public virtual StopStreamProcessorResponse StopStreamProcessor(StopStreamProcessorRequest request){var options = new InvokeOptions();options.RequestMarshaller = StopStreamProcessorRequestMarshaller.Instance;options.ResponseUnmarshaller = StopStreamProcessorResponseUnmarshaller.Instance;return Invoke<StopStreamProcessorResponse>(request, options);}
// Original:
public static AttrPtg createIf(int dist) {return new AttrPtg(optiIf.set(0), dist, null, -1);}

// Translation:
public static AttrPtg CreateIf(int dist){return new AttrPtg(optiIf.Set(0), dist, null, -1);}
// Original:
public DeleteIAMPolicyAssignmentResult deleteIAMPolicyAssignment(DeleteIAMPolicyAssignmentRequest request) {request = beforeClientExecution(request);return executeDeleteIAMPolicyAssignment(request);}

// Translation:
public virtual DeleteIAMPolicyAssignmentResponse DeleteIAMPolicyAssignment(DeleteIAMPolicyAssignmentRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteIAMPolicyAssignmentRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteIAMPolicyAssignmentResponseUnmarshaller.Instance;return Invoke<DeleteIAMPolicyAssignmentResponse>(request, options);}
// Original:
public UpdateCampaignResult updateCampaign(UpdateCampaignRequest request) {request = beforeClientExecution(request);return executeUpdateCampaign(request);}

// Translation:
public virtual UpdateCampaignResponse UpdateCampaign(UpdateCampaignRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateCampaignRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateCampaignResponseUnmarshaller.Instance;return Invoke<UpdateCampaignResponse>(request, options);}
// Original:
public LexerActionExecutor fixOffsetBeforeMatch(int offset) {LexerAction[] updatedLexerActions = null;for (int i = 0; i < lexerActions.length; i++) {if (lexerActions[i].isPositionDependent() && !(lexerActions[i] instanceof LexerIndexedCustomAction)) {if (updatedLexerActions == null) {updatedLexerActions = lexerActions.clone();}updatedLexerActions[i] = new LexerIndexedCustomAction(offset, lexerActions[i]);}}if (updatedLexerActions == null) {return this;}return new LexerActionExecutor(updatedLexerActions);}

// Translation:
public virtual Antlr4.Runtime.Atn.LexerActionExecutor FixOffsetBeforeMatch(int offset){ILexerAction[] updatedLexerActions = null;for (int i = 0; i < lexerActions.Length; i++){if (lexerActions[i].IsPositionDependent && !(lexerActions[i] is LexerIndexedCustomAction)){if (updatedLexerActions == null){updatedLexerActions = (ILexerAction[])lexerActions.Clone();}updatedLexerActions[i] = new LexerIndexedCustomAction(offset, lexerActions[i]);}}if (updatedLexerActions == null){return this;}return new Antlr4.Runtime.Atn.LexerActionExecutor(updatedLexerActions);}
// Original:
public void protectSheet(String password, boolean shouldProtectObjects,boolean shouldProtectScenarios) {if (password == null) {_passwordRecord = null;_protectRecord = null;_objectProtectRecord = null;_scenarioProtectRecord = null;return;}ProtectRecord prec = getProtect();PasswordRecord pass = getPassword();prec.setProtect(true);pass.setPassword((short)CryptoFunctions.createXorVerifier1(password));if (_objectProtectRecord == null && shouldProtectObjects) {ObjectProtectRecord rec = createObjectProtect();rec.setProtect(true);_objectProtectRecord = rec;}if (_scenarioProtectRecord == null && shouldProtectScenarios) {ScenarioProtectRecord srec = createScenarioProtect();srec.setProtect(true);_scenarioProtectRecord = srec;}}

// Translation:
public void ProtectSheet(String password, bool shouldProtectObjects,bool shouldProtectScenarios){if (password == null){_passwordRecord = null;_protectRecord = null;_objectProtectRecord = null;_scenarioProtectRecord = null;return;}ProtectRecord prec = this.Protect;PasswordRecord pass = this.Password;prec.Protect = true;pass.Password = (PasswordRecord.HashPassword(password));if (_objectProtectRecord == null && shouldProtectObjects){ObjectProtectRecord rec = CreateObjectProtect();rec.Protect = (true);_objectProtectRecord = rec;}if (_scenarioProtectRecord == null && shouldProtectScenarios){ScenarioProtectRecord srec = CreateScenarioProtect();srec.Protect = (true);_scenarioProtectRecord = srec;}}
// Original:
public PackedDataOutput(DataOutput out) {this.out = out;current = 0;remainingBits = 8;}

// Translation:
public PackedDataOutput(DataOutput @out){this.@out = @out;current = 0;remainingBits = 8;}
// Original:
public CFRuleBase getRule(int idx) {checkRuleIndex(idx);return rules.get(idx);}

// Translation:
public CFRuleRecord GetRule(int idx){CheckRuleIndex(idx);return rules[idx];}
// Original:
public FieldCacheSource(String field) {this.field=field;}

// Translation:
public FieldCacheSource(string field){this.m_field = field;}
// Original:
public IndonesianStemFilterFactory(Map<String,String> args) {super(args);stemDerivational = getBoolean(args, "stemDerivational", true);if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}

// Translation:
public IndonesianStemFilterFactory(IDictionary<string, string> args): base(args){stemDerivational = GetBoolean(args, "stemDerivational", true);if (args.Count > 0){throw new System.ArgumentException("Unknown parameters: " + args);}}
// Original:
public boolean isOffsetOverlap( WeightedPhraseInfo other ){int so = getStartOffset();int eo = getEndOffset();int oso = other.getStartOffset();int oeo = other.getEndOffset();if( so <= oso && oso < eo ) return true;if( so < oeo && oeo <= eo ) return true;if( oso <= so && so < oeo ) return true;if( oso < eo && eo <= oeo ) return true;return false;}

// Translation:
public virtual bool IsOffsetOverlap(WeightedPhraseInfo other){int so = StartOffset;int eo = EndOffset;int oso = other.StartOffset;int oeo = other.EndOffset;if (so <= oso && oso < eo) return true;if (so < oeo && oeo <= eo) return true;if (oso <= so && so < oeo) return true;if (oso < eo && eo <= oeo) return true;return false;}
// Original:
public MergeAlgorithm(DiffAlgorithm diff) {this.diffAlg = diff;}

// Translation:
public MergeAlgorithm(DiffAlgorithm diff){this.diffAlg = diff;}
// Original:
public void serialize(LittleEndianOutput out) {out.writeInt(field_1_xAxisUpperLeft);out.writeInt(field_2_yAxisUpperLeft);out.writeInt(field_3_xSize);out.writeInt(field_4_ySize);out.writeByte(field_5_type);out.writeByte(field_6_spacing);out.writeShort(field_7_options);}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteInt(field_1_xAxisUpperLeft);out1.WriteInt(field_2_yAxisUpperLeft);out1.WriteInt(field_3_xSize);out1.WriteInt(field_4_ySize);out1.WriteByte(field_5_type);out1.WriteByte(field_6_spacing);out1.WriteShort(field_7_options);}
// Original:
public long get(int index) {final int o = index / 21;final int b = index % 21;final int shift = b * 3;return (blocks[o] >>> shift) & 7L;}

// Translation:
public override long Get(int index){int o = index / 21;int b = index % 21;int shift = b * 3;return ((long)((ulong)blocks[o] >> shift)) & 7L;}
// Original:
public CodingErrorAction unmappableCharacterAction() {return unmappableCharacterAction;}

// Translation:
public virtual java.nio.charset.CodingErrorAction unmappableCharacterAction(){return _unmappableCharacterAction;}
// Original:
public Set<String> getSet(Map<String,String> args, String name) {String s = args.remove(name);if (s == null) {return null;} else {Set<String> set = null;Matcher matcher = ITEM_PATTERN.matcher(s);if (matcher.find()) {set = new HashSet<>();set.add(matcher.group(0));while (matcher.find()) {set.add(matcher.group(0));}}return set;}}

// Translation:
public virtual ISet<string> GetSet(IDictionary<string, string> args, string name){string s;if (args.TryGetValue(name, out s)){args.Remove(name);ISet<string> set = null;Match matcher = ITEM_PATTERN.Match(s);if (matcher.Success){set = new JCG.HashSet<string>{matcher.Groups[0].Value};matcher = matcher.NextMatch();while (matcher.Success){set.Add(matcher.Groups[0].Value);matcher = matcher.NextMatch();}}return set;}return null;}
// Original:
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader)throws IncorrectObjectTypeException, IOException {if (currentSubtree == null)throw new IncorrectObjectTypeException(getEntryObjectId(),Constants.TYPE_TREE);return new DirCacheIterator(this, currentSubtree);}

// Translation:
public override AbstractTreeIterator CreateSubtreeIterator(ObjectReader reader){if (currentSubtree == null){throw new IncorrectObjectTypeException(EntryObjectId, Constants.TYPE_TREE);}return new NGit.Dircache.DirCacheIterator(this, currentSubtree);}
// Original:
public Explanation[] getDetails() {return details.toArray(new Explanation[0]);}

// Translation:
public virtual Explanation[] GetDetails(){if (details == null){return null;}return details.ToArray();}
// Original:
public String toString() {if ( text==null ) {return "<DeleteOp@"+tokens.get(index)+".."+tokens.get(lastIndex)+">";}return "<ReplaceOp@"+tokens.get(index)+".."+tokens.get(lastIndex)+":\""+text+"\">";}

// Translation:
public override string ToString(){string opName = GetType().FullName;int index = opName.IndexOf('$');opName = Sharpen.Runtime.Substring(opName, index + 1, opName.Length);return "<" + opName + "@" + tokens.Get(this.index) + ":\"" + text + "\">";}
// Original:
public String toString(){StringBuilder buffer = new StringBuilder();buffer.append( "[TopMargin]\n" );buffer.append( "    .margin               = " ).append( " (" ).append( getMargin() ).append( " )\n" );buffer.append( "[/TopMargin]\n" );return buffer.toString();}

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

// Translation:
static public double FV(double r, int nper, double c, double pv){return FV(r, nper, c, pv, 0);}
// Original:
@Override public boolean remove(Object object) {Object[] a = array;int s = size;if (object != null) {for (int i = 0; i < s; i++) {if (object.equals(a[i])) {System.arraycopy(a, i + 1, a, i, --s - i);a[s] = null;  size = s;modCount++;return true;}}} else {for (int i = 0; i < s; i++) {if (a[i] == null) {System.arraycopy(a, i + 1, a, i, --s - i);a[s] = null;  size = s;modCount++;return true;}}}return false;}

// Translation:
public override bool remove(object @object){object[] a = array;int s = _size;if (@object != null){{for (int i = 0; i < s; i++){if (@object.Equals(a[i])){System.Array.Copy(a, i + 1, a, i, --s - i);a[s] = null;_size = s;modCount++;return true;}}}}else{{for (int i = 0; i < s; i++){if (a[i] == null){System.Array.Copy(a, i + 1, a, i, --s - i);a[s] = null;_size = s;modCount++;return true;}}}}return false;}
// Original:
public MergeCellsRecord(CellRangeAddress[] regions, int startIndex, int numberOfRegions) {_regions = regions;_startIndex = startIndex;_numberOfRegions = numberOfRegions;}

// Translation:
public MergeCellsRecord(CellRangeAddress[] regions, int startIndex, int numberOfRegions){_regions = regions;_startIndex = startIndex;_numberOfRegions = numberOfRegions;}
// Original:
public Cluster resizeCluster(ResizeClusterRequest request) {request = beforeClientExecution(request);return executeResizeCluster(request);}

// Translation:
public virtual ResizeClusterResponse ResizeCluster(ResizeClusterRequest request){var options = new InvokeOptions();options.RequestMarshaller = ResizeClusterRequestMarshaller.Instance;options.ResponseUnmarshaller = ResizeClusterResponseUnmarshaller.Instance;return Invoke<ResizeClusterResponse>(request, options);}
// Original:
public int getParent(int ordinal) throws IOException {ensureOpen();Objects.checkIndex(ordinal, nextID);int[] parents = getTaxoArrays().parents();assert ordinal < parents.length : "requested ordinal (" + ordinal + "); parents.length (" + parents.length + ") !";return parents[ordinal];}

// Translation:
public virtual int GetParent(int ordinal){EnsureOpen();if (ordinal >= nextID){throw new System.IndexOutOfRangeException("requested ordinal is bigger than the largest ordinal in the taxonomy");}int[] parents = GetTaxoArrays().Parents;Debug.Assert(ordinal < parents.Length, "requested ordinal (" + ordinal + "); parents.length (" + parents.Length + ") !");return parents[ordinal];}
// Original:
@Override public Iterator<Multiset.Entry<E>> iterator() {final Iterator<Map.Entry<E, AtomicInteger>> backingEntries= backingMap.entrySet().iterator();return new Iterator<Multiset.Entry<E>>() {Map.Entry<E, AtomicInteger> toRemove;

// Translation:
public override java.util.Iterator<java.util.MapClass.Entry<K, V>> iterator(){return new java.util.Hashtable<K, V>.EntryIterator(this._enclosing);}
// Original:
public int alloc(int size) {int index = n;int len = array.length;if (n + size >= len) {char[] aux = new char[len + blockSize];System.arraycopy(array, 0, aux, 0, len);array = aux;}n += size;return index;}

// Translation:
public virtual int Alloc(int size){int index = n;int len = array.Length;if (n + size >= len){char[] aux = new char[len + blockSize];System.Array.Copy(array, 0, aux, 0, len);array = aux;}n += size;return index;}
// Original:
public static String getInflectionTypeTranslation(String s) {return inflTypeTranslations.get(s);}

// Translation:
public static string GetInflectionTypeTranslation(string s){string result;inflTypeTranslations.TryGetValue(s, out result);return result;}
// Original:
public Note call() throws GitAPIException {checkCallable();try (RevWalk walk = new RevWalk(repo);ObjectInserter inserter = repo.newObjectInserter()) {NoteMap map = NoteMap.newEmptyMap();RevCommit notesCommit = null;Ref ref = repo.exactRef(notesRef);if (ref != null) {notesCommit = walk.parseCommit(ref.getObjectId());map = NoteMap.read(walk.getObjectReader(), notesCommit);}map.set(id, null, inserter);AddNoteCommand.commitNoteMap(repo, notesRef, walk, map, notesCommit,inserter,"Notes removed by 'git notes remove'"); return map.getNote(id);} catch (IOException e) {throw new JGitInternalException(e.getMessage(), e);}}

// Translation:
public override Note Call(){CheckCallable();RevWalk walk = new RevWalk(repo);ObjectInserter inserter = repo.NewObjectInserter();NoteMap map = NoteMap.NewEmptyMap();RevCommit notesCommit = null;try{Ref @ref = repo.GetRef(notesRef);if (@ref != null){notesCommit = walk.ParseCommit(@ref.GetObjectId());map = NoteMap.Read(walk.GetObjectReader(), notesCommit);}map.Set(id, null, inserter);CommitNoteMap(walk, map, notesCommit, inserter, "Notes removed by 'git notes remove'");return map.GetNote(id);}catch (IOException e){throw new JGitInternalException(e.Message, e);}finally{inserter.Release();walk.Release();}}
// Original:
public String getNewPath() {return newPath;}

// Translation:
public virtual string GetNewPath(){return newPath;}
// Original:
public UserSViewBegin(byte[] data) {_rawData = data;}

// Translation:
public UserSViewBegin(byte[] data){_rawData = data;}
// Original:
public CreateMountTargetResult createMountTarget(CreateMountTargetRequest request) {request = beforeClientExecution(request);return executeCreateMountTarget(request);}

// Translation:
public virtual CreateMountTargetResponse CreateMountTarget(CreateMountTargetRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateMountTargetRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateMountTargetResponseUnmarshaller.Instance;return Invoke<CreateMountTargetResponse>(request, options);}
// Original:
public DeleteSubnetRequest(String subnetId) {setSubnetId(subnetId);}

// Translation:
public DeleteSubnetRequest(string subnetId){_subnetId = subnetId;}
// Original:
public void setTitle(String title) {this.title = title;}

// Translation:
public void SetTitle(String title){this.title = title;}
// Original:
public char current() {if (offset == end) {return DONE;}return string.charAt(offset);}

// Translation:
public char current(){if (offset == end){return java.text.CharacterIteratorClass.DONE;}return @string[offset];}
// Original:
public void add(long n) {if (count == entries.length)grow();entries[count++] = n;}

// Translation:
public virtual void Add(long n){if (count == entries.Length){Grow();}entries[count++] = n;}
// Original:
public FloatBuffer put(int index, float c) {checkIndex(index);backingArray[offset + index] = c;return this;}

// Translation:
public override java.nio.FloatBuffer put(int index, float c){checkIndex(index);backingArray[offset + index] = c;return this;}
// Original:
public ListGroupPoliciesRequest(String groupName) {setGroupName(groupName);}

// Translation:
public ListGroupPoliciesRequest(string groupName){_groupName = groupName;}
// Original:
public void setDeltaSearchWindowSize(int objectCount) {if (objectCount <= 2)setDeltaCompress(false);elsedeltaSearchWindowSize = objectCount;}

// Translation:
public virtual void SetDeltaSearchWindowSize(int objectCount){if (objectCount <= 2){SetDeltaCompress(false);}else{deltaSearchWindowSize = objectCount;}}
// Original:
public int nextDoc() {while (true) {if (queue.size() == 0) {doc = NO_MORE_DOCS;break;}int newDoc = queue.top().docID();if (newDoc != doc) {assert newDoc > doc: "doc=" + doc + " newDoc=" + newDoc;doc = newDoc;break;}if (queue.top().nextDoc() == NO_MORE_DOCS) {queue.pop();} else {queue.updateTop();}}return doc;}

// Translation:
public override int NextDoc(){if (idx >= size){value = null;return doc = DocIdSetIterator.NO_MORE_DOCS;}doc = (int)docs.Get(idx);++idx;while (idx < size && docs.Get(idx) == doc){++idx;}if (!docsWithField.Get((int)(idx - 1))){value = null;}else{value = values.Get(idx - 1);}return doc;}