yijunyu/c-to-rust huggingface dataset:
// Original:
public <T extends EscherProperty> T lookup( int propId ) {return (T)properties.stream().filter(p -> p.getPropertyNumber() == propId).findFirst().orElse(null);}

// Translation:
public EscherProperty Lookup(int propId){foreach (EscherProperty prop in properties){if (prop.PropertyNumber == propId){return prop;}}return null;}
// Original:
public boolean isExpectingOldObjectId() {return expectedOldObjectId != null;}

// Translation:
public virtual bool IsExpectingOldObjectId(){return expectedOldObjectId != null;}
// Original:
public int compareTo(ScoreTerm other) {if (term.bytesEquals(other.term))return 0; if (this.boost == other.boost)return other.term.compareTo(this.term);elsereturn Float.compare(this.boost, other.boost);}

// Translation:
public int CompareTo(ScoreTerm other){if (this.Boost == other.Boost){return TermComp.Compare(other.Bytes, this.Bytes);}else{return this.Boost.CompareTo(other.Boost);}}
// Original:
public LazyAreaEval getColumn(int columnIndex) {if (columnIndex >= getWidth()) {throw new IllegalArgumentException("Invalid columnIndex " + columnIndex+ ".  Allowable range is (0.." + getWidth() + ").");}int absColIx = getFirstColumn() + columnIndex;return new LazyAreaEval(getFirstRow(), absColIx, getLastRow(), absColIx, _evaluator);}

// Translation:
public override TwoDEval GetColumn(int columnIndex){if (columnIndex >= Width){throw new ArgumentException("Invalid columnIndex " + columnIndex+ ".  Allowable range is (0.." + Width + ").");}int absColIx = FirstColumn + columnIndex;return new LazyAreaEval(FirstRow, absColIx, LastRow, absColIx, _evaluator);}
// Original:
public BytesRef next() throws IOException {if (done) {return null;}boolean success = false;BytesRef result;try {String line;if ((line = in.readLine()) != null) {spare.copyChars(line);result = spare.get();} else {done = true;IOUtils.close(in);result = null;}success = true;} finally {if (!success) {IOUtils.closeWhileHandlingException(in);}}return result;}

// Translation:
public BytesRef Next(){if (done){return null;}bool success = false;BytesRef result;try{string line;if ((line = outerInstance.@in.ReadLine()) != null){spare.CopyChars(line);result = spare;}else{done = true;IOUtils.Dispose(outerInstance.@in);result = null;}success = true;}finally{if (!success){IOUtils.DisposeWhileHandlingException(outerInstance.@in);}}return result;}
// Original:
public boolean shouldBeRecursive() {return path.shouldBeRecursive();}

// Translation:
public override bool ShouldBeRecursive(){return path.ShouldBeRecursive();}
// Original:
public String toString() {return getClass().getSimpleName() + "(compressionMode=" + compressionMode+ ", chunkSize=" + chunkSize + ", blockSize=" + blockSize + ")";}

// Translation:
public override string ToString(){return this.GetType().Name + "(compressionMode=" + compressionMode + ", chunkSize=" + chunkSize + ")";}
// Original:
public ResourcePendingMaintenanceActions applyPendingMaintenanceAction(ApplyPendingMaintenanceActionRequest request) {request = beforeClientExecution(request);return executeApplyPendingMaintenanceAction(request);}

// Translation:
public virtual ApplyPendingMaintenanceActionResponse ApplyPendingMaintenanceAction(ApplyPendingMaintenanceActionRequest request){var options = new InvokeOptions();options.RequestMarshaller = ApplyPendingMaintenanceActionRequestMarshaller.Instance;options.ResponseUnmarshaller = ApplyPendingMaintenanceActionResponseUnmarshaller.Instance;return Invoke<ApplyPendingMaintenanceActionResponse>(request, options);}
// Original:
public boolean startsWith(AbbreviatedObjectId abbr) {return abbr.prefixCompare(this) == 0;}

// Translation:
public virtual bool StartsWith(AbbreviatedObjectId abbr){return abbr.PrefixCompare(this) == 0;}
// Original:
public SerializingRecordVisitor(byte[] data, int startOffset) {_data = data;_startOffset = startOffset;_countBytesWritten = 0;}

// Translation:
public SerializingRecordVisitor(byte[] data, int startOffset){_data = data;_startOffset = startOffset;_countBytesWritten = 0;}
// Original:
public static TreeFilter createFromStrings(Collection<String> paths) {if (paths.isEmpty())throw new IllegalArgumentException(JGitText.get().atLeastOnePathIsRequired);final PathFilter[] p = new PathFilter[paths.size()];int i = 0;for (String s : paths)p[i++] = PathFilter.create(s);return create(p);}

// Translation:
public static TreeFilter CreateFromStrings(ICollection<string> paths){if (paths.IsEmpty()){throw new ArgumentException(JGitText.Get().atLeastOnePathIsRequired);}PathFilter[] p = new PathFilter[paths.Count];int i = 0;foreach (string s in paths){p[i++] = PathFilter.Create(s);}return Create(p);}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(getDefaultCountry());out.writeShort(getCurrentCountry());}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(DefaultCountry);out1.WriteShort(CurrentCountry);}
// Original:
@Override public boolean equals(Object object) {synchronized (mutex) {return list.equals(object);}}

// Translation:
public override bool Equals(object @object){lock (mutex){return list.Equals(@object);}}
// Original:
public CellFormatter(String format) {this(LocaleUtil.getUserLocale(), format);}

// Translation:
public CellFormatter(String format){this.format = format;}
// Original:
public ObjectId getResultTreeId() {return resultTree;}

// Translation:
public override ObjectId GetResultTreeId(){return resultTree;}
// Original:
public DrillDownQuery clone() {return new DrillDownQuery(config, baseQuery, dimQueries, drillDownDims);}

// Translation:
public override object Clone(){return new DrillDownQuery(config, query, drillDownDims);}
// Original:
public final ShortBuffer put(short[] src, int srcOffset, int shortCount) {throw new ReadOnlyBufferException();}

// Translation:
public sealed override java.nio.ShortBuffer put(short[] src, int srcOffset, int shortCount){throw new java.nio.ReadOnlyBufferException();}
// Original:
public final void writeLong(long val) throws IOException {Memory.pokeLong(scratch, 0, val, ByteOrder.BIG_ENDIAN);write(scratch, 0, SizeOf.LONG);}

// Translation:
public virtual void writeLong(long val){throw new System.NotImplementedException();}
// Original:
public AuthorizeSecurityGroupEgressResult authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest request) {request = beforeClientExecution(request);return executeAuthorizeSecurityGroupEgress(request);}

// Translation:
public virtual AuthorizeSecurityGroupEgressResponse AuthorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest request){var options = new InvokeOptions();options.RequestMarshaller = AuthorizeSecurityGroupEgressRequestMarshaller.Instance;options.ResponseUnmarshaller = AuthorizeSecurityGroupEgressResponseUnmarshaller.Instance;return Invoke<AuthorizeSecurityGroupEgressResponse>(request, options);}
// Original:
public void add(E object) {throw new UnsupportedOperationException();}

// Translation:
public virtual void add(E @object){throw new System.NotSupportedException();}
// Original:
public static String getPOSTranslation(String s) {return posTranslations.get(s);}

// Translation:
public static string GetPOSTranslation(string s){string result;posTranslations.TryGetValue(s, out result);return result;}
// Original:
public AnalyticsTagPredicate(Tag tag) {this.tag = tag;}

// Translation:
public AnalyticsTagPredicate(Tag tag){this.tag = tag;}
// Original:
public String toInfoString(Parser recognizer) {List<String> rules = recognizer.getRuleInvocationStack(this);Collections.reverse(rules);return "ParserRuleContext"+rules+"{" +"start=" + start +", stop=" + stop +'}';}

// Translation:
public virtual string ToInfoString(Parser recognizer){List<string> rules = new List<string>(recognizer.GetRuleInvocationStack(this));rules.Reverse();return "ParserRuleContext" + rules + "{" + "start=" + _start + ", stop=" + _stop + '}';}
// Original:
public CharBuffer put(int index, char c) {checkIndex(index);backingArray[offset + index] = c;return this;}

// Translation:
public override java.nio.CharBuffer put(int index, char c){checkIndex(index);backingArray[offset + index] = c;return this;}
// Original:
public CreateComponentResult createComponent(CreateComponentRequest request) {request = beforeClientExecution(request);return executeCreateComponent(request);}

// Translation:
public virtual CreateComponentResponse CreateComponent(CreateComponentRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateComponentRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateComponentResponseUnmarshaller.Instance;return Invoke<CreateComponentResponse>(request, options);}
// Original:
public RuleWithSuffixExceptions(String suffix, int min, String replacement,String[] exceptions) {super(suffix, min, replacement);for (int i = 0; i < exceptions.length; i++) {if (!exceptions[i].endsWith(suffix))throw new RuntimeException("warning: useless exception '" + exceptions[i] + "' does not end with '" + suffix + "'");}this.exceptions = new char[exceptions.length][];for (int i = 0; i < exceptions.length; i++)this.exceptions[i] = exceptions[i].toCharArray();}

// Translation:
public RuleWithSuffixExceptions(string suffix, int min, string replacement, string[] exceptions) : base(suffix, min, replacement){for (int i = 0; i < exceptions.Length; i++){if (!exceptions[i].EndsWith(suffix, StringComparison.Ordinal)){throw new Exception("warning: useless exception '" + exceptions[i] + "' does not end with '" + suffix + "'");}}this.m_exceptions = new char[exceptions.Length][];for (int i = 0; i < exceptions.Length; i++){this.m_exceptions[i] = exceptions[i].ToCharArray();}}
// Original:
public DescribeVpnGatewaysResult describeVpnGateways(DescribeVpnGatewaysRequest request) {request = beforeClientExecution(request);return executeDescribeVpnGateways(request);}

// Translation:
public virtual DescribeVpnGatewaysResponse DescribeVpnGateways(DescribeVpnGatewaysRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeVpnGatewaysRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeVpnGatewaysResponseUnmarshaller.Instance;return Invoke<DescribeVpnGatewaysResponse>(request, options);}
// Original:
public HSSFClientAnchor(EscherClientAnchorRecord escherClientAnchorRecord) {this._escherClientAnchor = escherClientAnchorRecord;}

// Translation:
public HSSFClientAnchor(EscherClientAnchorRecord escherClientAnchorRecord){this._escherClientAnchor = escherClientAnchorRecord;}
// Original:
public void stopNow() {stopNow = true;}

// Translation:
public virtual void StopNow(){stopNow = true;}
// Original:
public String toString() {return "FooterKey[" + name + "]";}

// Translation:
public override string ToString(){return "FooterKey[" + name + "]";}
// Original:
public GetRelationalDatabasesResult getRelationalDatabases(GetRelationalDatabasesRequest request) {request = beforeClientExecution(request);return executeGetRelationalDatabases(request);}

// Translation:
public virtual GetRelationalDatabasesResponse GetRelationalDatabases(GetRelationalDatabasesRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetRelationalDatabasesRequestMarshaller.Instance;options.ResponseUnmarshaller = GetRelationalDatabasesResponseUnmarshaller.Instance;return Invoke<GetRelationalDatabasesResponse>(request, options);}
// Original:
public int compareTo(Revision o) {IndexRevision other = (IndexRevision) o;return commit.compareTo(other.commit);}

// Translation:
public virtual int CompareTo(IRevision other){IndexRevision or = (IndexRevision)other;return commit.CompareTo(or.commit);}
// Original:
public PredPrediction(SemanticContext pred, int alt) {this.alt = alt;this.pred = pred;}

// Translation:
public PredPrediction(SemanticContext pred, int alt){this.alt = alt;this.pred = pred;}
// Original:
public ListMeetingTagsResult listMeetingTags(ListMeetingTagsRequest request) {request = beforeClientExecution(request);return executeListMeetingTags(request);}

// Translation:
public virtual ListMeetingTagsResponse ListMeetingTags(ListMeetingTagsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListMeetingTagsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListMeetingTagsResponseUnmarshaller.Instance;return Invoke<ListMeetingTagsResponse>(request, options);}
// Original:
public TokenStream create(TokenStream input) {return new NorwegianMinimalStemFilter(input, flags);}

// Translation:
public override TokenStream Create(TokenStream input){return new NorwegianMinimalStemFilter(input, flags);}
// Original:
public ImportInstanceResult importInstance(ImportInstanceRequest request) {request = beforeClientExecution(request);return executeImportInstance(request);}

// Translation:
public virtual ImportInstanceResponse ImportInstance(ImportInstanceRequest request){var options = new InvokeOptions();options.RequestMarshaller = ImportInstanceRequestMarshaller.Instance;options.ResponseUnmarshaller = ImportInstanceResponseUnmarshaller.Instance;return Invoke<ImportInstanceResponse>(request, options);}
// Original:
public void setCodePage(CodepageRecord codepage) {this.codepage = codepage;}

// Translation:
public void SetCodePage(CodepageRecord codepage){this.codepage = codepage;}
// Original:
@Override public Collection<V> values() {Collection<V> vs = values;return (vs != null) ? vs : (values = new Values());}

// Translation:
public override java.util.Collection<V> values(){java.util.Collection<V> vs = _values;return (vs != null) ? vs : (_values = new java.util.HashMap<K, V>.Values(this));}
// Original:
public UpdateRulesOfIpGroupResult updateRulesOfIpGroup(UpdateRulesOfIpGroupRequest request) {request = beforeClientExecution(request);return executeUpdateRulesOfIpGroup(request);}

// Translation:
public virtual UpdateRulesOfIpGroupResponse UpdateRulesOfIpGroup(UpdateRulesOfIpGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateRulesOfIpGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateRulesOfIpGroupResponseUnmarshaller.Instance;return Invoke<UpdateRulesOfIpGroupResponse>(request, options);}
// Original:
public String toString() {return "OneOrMoreOutputs(" + outputs + ")";}

// Translation:
public override string ToString(){return "OneOrMoreOutputs(" + outputs + ")";}
// Original:
public static TreeFilter create(TreeFilter a, TreeFilter b) {if (a == ALL || b == ALL)return ALL;return new Binary(a, b);}

// Translation:
public static TreeFilter Create(TreeFilter a, TreeFilter b){if (a == ALL || b == ALL){return ALL;}return new OrTreeFilter.Binary(a, b);}
// Original:
public UntagQueueResult untagQueue(UntagQueueRequest request) {request = beforeClientExecution(request);return executeUntagQueue(request);}

// Translation:
public virtual UntagQueueResponse UntagQueue(UntagQueueRequest request){var options = new InvokeOptions();options.RequestMarshaller = UntagQueueRequestMarshaller.Instance;options.ResponseUnmarshaller = UntagQueueResponseUnmarshaller.Instance;return Invoke<UntagQueueResponse>(request, options);}
// Original:
public final double getDouble(int index) {return Double.longBitsToDouble(getLong(index));}

// Translation:
public sealed override double getDouble(int index){return Sharpen.Util.LongBitsToDouble(getLong(index));}
// Original:
public V next() {return entryIterator.next().getValue();}

// Translation:
public override V next(){return this.nextEntry().value;}
// Original:
public IntervalSet(int... els) {if ( els==null ) {intervals = new ArrayList<Interval>(2); }else {intervals = new ArrayList<Interval>(els.length);for (int e : els) add(e);}}

// Translation:
public IntervalSet(params int[] els){if (els == null){intervals = new ArrayList<Interval>(2);}else{intervals = new ArrayList<Interval>(els.Length);foreach (int e in els){Add(e);}}}
// Original:
public void dumpDeadEndConfigs(NoViableAltException nvae) {System.err.println("dead end configs: ");for (ATNConfig c : nvae.getDeadEndConfigs()) {String trans = "no edges";if ( c.state.getNumberOfTransitions()>0 ) {Transition t = c.state.transition(0);if ( t instanceof AtomTransition) {AtomTransition at = (AtomTransition)t;trans = "Atom "+getTokenName(at.label);}else if ( t instanceof SetTransition ) {SetTransition st = (SetTransition)t;boolean not = st instanceof NotSetTransition;trans = (not?"~":"")+"Set "+st.set.toString();}}System.err.println(c.toString(parser, true)+":"+trans);}}

// Translation:
public void DumpDeadEndConfigs(NoViableAltException nvae){#if !PORTABLESystem.Console.Error.WriteLine("dead end configs: ");#endifforeach (ATNConfig c in nvae.DeadEndConfigs.configs){String trans = "no edges";if (c.state.NumberOfTransitions > 0){Transition t = c.state.Transition(0);if (t is AtomTransition){AtomTransition at = (AtomTransition)t;trans = "Atom " + GetTokenName(at.token);}else if (t is SetTransition){SetTransition st = (SetTransition)t;bool not = st is NotSetTransition;trans = (not ? "~" : "") + "Set " + st.set.ToString();}}#if !PORTABLESystem.Console.Error.WriteLine(c.ToString(parser, true) + ":" + trans);#endif}}
// Original:
public String toString() {StringBuilder sb = new StringBuilder();sb.append("[SUPBOOK ");if(isExternalReferences()) {sb.append("External References]\n");sb.append(" .url     = ").append(getURL()).append("\n");sb.append(" .nSheets = ").append(field_1_number_of_sheets).append("\n");for (String sheetname : field_3_sheet_names) {sb.append("    .name = ").append(sheetname).append("\n");}sb.append("[/SUPBOOK");} else if(_isAddInFunctions) {sb.append("Add-In Functions");} else {sb.append("Internal References");sb.append(" nSheets=").append(field_1_number_of_sheets);}sb.append("]");return sb.toString();}

// Translation:
public override String ToString(){StringBuilder sb = new StringBuilder();sb.Append("[SUPBOOK ");if (IsExternalReferences){sb.Append("External References]\n");sb.Append(" .url     = ").Append(field_2_encoded_url).Append("\n");sb.Append(" .nSheets = ").Append(field_1_number_of_sheets).Append("\n");foreach (String sheetname in field_3_sheet_names){sb.Append("    .name = ").Append(sheetname).Append("\n");}sb.Append("[/SUPBOOK");}else if (_isAddInFunctions){sb.Append("Add-In Functions");}else{sb.Append("Internal References ");sb.Append(" nSheets= ").Append(field_1_number_of_sheets);}return sb.ToString();}
// Original:
public String toString() {StringBuilder sb = new StringBuilder(256);sb.append("[ftLbsData]\n");sb.append("    .unknownShort1 =").append(HexDump.shortToHex(_cbFContinued)).append("\n");sb.append("    .formula        = ").append('\n');if(_linkPtg != null) {sb.append(_linkPtg).append(_linkPtg.getRVAType()).append('\n');}sb.append("    .nEntryCount   =").append(HexDump.shortToHex(_cLines)).append("\n");sb.append("    .selEntryIx    =").append(HexDump.shortToHex(_iSel)).append("\n");sb.append("    .style         =").append(HexDump.shortToHex(_flags)).append("\n");sb.append("    .unknownShort10=").append(HexDump.shortToHex(_idEdit)).append("\n");if(_dropData != null) {sb.append('\n').append(_dropData);}sb.append("[/ftLbsData]\n");return sb.toString();}

// Translation:
public override String ToString(){StringBuilder sb = new StringBuilder(256);sb.Append("[ftLbsData]\n");sb.Append("    .unknownshort1 =").Append(HexDump.ShortToHex(_cbFContinued)).Append("\n");sb.Append("    .formula        = ").Append('\n');sb.Append(_linkPtg.ToString()).Append(_linkPtg.RVAType).Append('\n');sb.Append("    .nEntryCount   =").Append(HexDump.ShortToHex(_cLines)).Append("\n");sb.Append("    .selEntryIx    =").Append(HexDump.ShortToHex(_iSel)).Append("\n");sb.Append("    .style         =").Append(HexDump.ShortToHex(_flags)).Append("\n");sb.Append("    .unknownshort10=").Append(HexDump.ShortToHex(_idEdit)).Append("\n");if (_dropData != null) sb.Append('\n').Append(_dropData.ToString());sb.Append("[/ftLbsData]\n");return sb.ToString();}
// Original:
public static QualityStats average(QualityStats[] stats) {QualityStats avg = new QualityStats(0,0);if (stats.length==0) {return avg;}int m = 0; for (int i=0; i<stats.length; i++) {avg.searchTime += stats[i].searchTime;avg.docNamesExtractTime += stats[i].docNamesExtractTime;if (stats[i].maxGoodPoints>0) {m++;avg.numGoodPoints += stats[i].numGoodPoints;avg.numPoints += stats[i].numPoints;avg.pReleventSum += stats[i].getAvp();avg.recall += stats[i].recall;avg.mrr += stats[i].getMRR();avg.maxGoodPoints += stats[i].maxGoodPoints;for (int j=1; j<avg.pAt.length; j++) {avg.pAt[j] += stats[i].getPrecisionAt(j);}}}assert m>0 : "Fishy: no \"good\" queries!";avg.searchTime /= stats.length;avg.docNamesExtractTime /= stats.length;avg.numGoodPoints /= m;avg.numPoints /= m;avg.recall /= m;avg.mrr /= m;avg.maxGoodPoints /= m;for (int j=1; j<avg.pAt.length; j++) {avg.pAt[j] /= m;}avg.pReleventSum /= m;                 avg.pReleventSum *= avg.maxGoodPoints; return avg;}

// Translation:
public static QualityStats Average(QualityStats[] stats){QualityStats avg = new QualityStats(0, 0);if (stats.Length == 0){return avg;}int m = 0; for (int i = 0; i < stats.Length; i++){avg.searchTime += stats[i].searchTime;avg.docNamesExtractTime += stats[i].docNamesExtractTime;if (stats[i].maxGoodPoints > 0){m++;avg.numGoodPoints += stats[i].numGoodPoints;avg.numPoints += stats[i].numPoints;avg.pReleventSum += stats[i].GetAvp();avg.recall += stats[i].recall;avg.mrr += stats[i].MRR;avg.maxGoodPoints += stats[i].maxGoodPoints;for (int j = 1; j < avg.pAt.Length; j++){avg.pAt[j] += stats[i].GetPrecisionAt(j);}}}Debug.Assert(m> 0, "Fishy: no \"good\" queries!");avg.searchTime /= stats.Length;avg.docNamesExtractTime /= stats.Length;avg.numGoodPoints /= m;avg.numPoints /= m;avg.recall /= m;avg.mrr /= m;avg.maxGoodPoints /= m;for (int j = 1; j < avg.pAt.Length; j++){avg.pAt[j] /= m;}avg.pReleventSum /= m;                 avg.pReleventSum *= avg.maxGoodPoints; return avg;}
// Original:
public String getUser() {return Host.this.getUser();}

// Translation:
public virtual string GetUser(){return user;}
// Original:
public int[] clear() {boost = null;termState = null;return super.clear();}

// Translation:
public override int[] Clear(){boost = null;termState = null;return base.Clear();}
// Original:
public DescribeApplicationSnapshotResult describeApplicationSnapshot(DescribeApplicationSnapshotRequest request) {request = beforeClientExecution(request);return executeDescribeApplicationSnapshot(request);}

// Translation:
public virtual DescribeApplicationSnapshotResponse DescribeApplicationSnapshot(DescribeApplicationSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeApplicationSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeApplicationSnapshotResponseUnmarshaller.Instance;return Invoke<DescribeApplicationSnapshotResponse>(request, options);}
// Original:
public FormatAndBits(Format format, int bitsPerValue) {this.format = format;this.bitsPerValue = bitsPerValue;}

// Translation:
public FormatAndBits(Format format, int bitsPerValue){this.Format = format;this.BitsPerValue = bitsPerValue;}
// Original:
public HSSFName getNameAt(int nameIndex) {int nNames = names.size();if (nNames < 1) {throw new IllegalStateException("There are no defined names in this workbook");}if (nameIndex < 0 || nameIndex > nNames) {throw new IllegalArgumentException("Specified name index " + nameIndex+ " is outside the allowable range (0.." + (nNames-1) + ").");}return names.get(nameIndex);}

// Translation:
public NPOI.SS.UserModel.IName GetNameAt(int nameIndex){int nNames = names.Count;if (nNames < 1){throw new InvalidOperationException("There are no defined names in this workbook");}if (nameIndex < 0 || nameIndex > nNames){throw new ArgumentOutOfRangeException("Specified name index " + nameIndex+ " is outside the allowable range (0.." + (nNames - 1) + ").");}HSSFName result = names[nameIndex];return result;}
// Original:
public void fromString(String str) {if (str.length() != Constants.OBJECT_ID_STRING_LENGTH)throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidId, str));fromHexString(Constants.encodeASCII(str), 0);}

// Translation:
public virtual void FromString(string str){if (str.Length != Constants.OBJECT_ID_STRING_LENGTH){throw new ArgumentException(MessageFormat.Format(JGitText.Get().invalidId, str));}FromHexString(Constants.EncodeASCII(str), 0);}