yijunyu/c-to-rust huggingface dataset:
// Original:
public CherryPickResult(RevCommit newHead, List<Ref> cherryPickedRefs) {this.status = CherryPickStatus.OK;this.newHead = newHead;this.cherryPickedRefs = cherryPickedRefs;this.failingPaths = null;}

// Translation:
public CherryPickResult(RevCommit newHead, IList<Ref> cherryPickedRefs){this.status = CherryPickResult.CherryPickStatus.OK;this.newHead = newHead;this.cherryPickedRefs = cherryPickedRefs;this.failingPaths = null;}
// Original:
public static Token newToken(int ofKind){return newToken(ofKind, null);}

// Translation:
public static Token NewToken(int ofKind){return NewToken(ofKind, null);}
// Original:
public HSSFClientAnchor getPreferredSize(double scale){return getPreferredSize(scale, scale);}

// Translation:
public IClientAnchor GetPreferredSize(double scale){return GetPreferredSize(scale, scale);}
// Original:
public UpdateInstanceRequest() {super("Ots", "2016-06-20", "UpdateInstance", "ots");setMethod(MethodType.POST);}

// Translation:
public UpdateInstanceRequest(): base("Ots", "2016-06-20", "UpdateInstance", "ots", "openAPI"){Method = MethodType.POST;}
// Original:
public ByteBuffer putInt(int index, int value) {checkIndex(index, SizeOf.INT);Memory.pokeInt(backingArray, offset + index, value, order);return this;}

// Translation:
public override java.nio.ByteBuffer putInt(int index, int value){checkIndex(index, libcore.io.SizeOf.INT);libcore.io.Memory.pokeInt(backingArray, offset + index, value, _order);return this;}
// Original:
public byte[] serialize() {int size = getDataSize() + 4;ByteArrayOutputStream baos = new ByteArrayOutputStream(size);serialize(new LittleEndianOutputStream(baos));if (baos.size() != size) {throw new RuntimeException("write size mismatch");}return baos.toByteArray();}

// Translation:
public byte[] Serialize(){int size = DataSize + 4;using (MemoryStream baos = new MemoryStream(size)){Serialize(new LittleEndianOutputStream(baos));if (baos.Length != size){throw new Exception("write size mismatch");}return baos.ToArray();}}
// Original:
public GetFieldLevelEncryptionProfileResult getFieldLevelEncryptionProfile(GetFieldLevelEncryptionProfileRequest request) {request = beforeClientExecution(request);return executeGetFieldLevelEncryptionProfile(request);}

// Translation:
public virtual GetFieldLevelEncryptionProfileResponse GetFieldLevelEncryptionProfile(GetFieldLevelEncryptionProfileRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetFieldLevelEncryptionProfileRequestMarshaller.Instance;options.ResponseUnmarshaller = GetFieldLevelEncryptionProfileResponseUnmarshaller.Instance;return Invoke<GetFieldLevelEncryptionProfileResponse>(request, options);}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(field_1_number_of_sheets);if(isExternalReferences()) {StringUtil.writeUnicodeString(out, field_2_encoded_url);for (String field_3_sheet_name : field_3_sheet_names) {StringUtil.writeUnicodeString(out, field_3_sheet_name);}} else {int field2val = _isAddInFunctions ? TAG_ADD_IN_FUNCTIONS : TAG_INTERNAL_REFERENCES;out.writeShort(field2val);}}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(field_1_number_of_sheets);if (IsExternalReferences){StringUtil.WriteUnicodeString(out1, field_2_encoded_url);for (int i = 0; i < field_3_sheet_names.Length; i++){StringUtil.WriteUnicodeString(out1, field_3_sheet_names[i]);}}else{int field2val = _isAddInFunctions ? TAG_ADD_IN_FUNCTIONS : TAG_INTERNAL_REFERENCES;out1.WriteShort(field2val);}}
// Original:
public BitsSlice(Bits parent, ReaderSlice slice) {this.parent = parent;this.start = slice.start;this.length = slice.length;assert length >= 0: "length=" + length;}

// Translation:
public BitsSlice(IBits parent, ReaderSlice slice){this.parent = parent;this.start = slice.Start;this.length = slice.Length;Debug.Assert(length >= 0, "length=" + length);}
// Original:
public void removeName(Name name) {int index = getNameIndex((HSSFName) name);removeName(index);}

// Translation:
public void RemoveName(int index){names.RemoveAt(index);workbook.RemoveName(index);}
// Original:
public ListConfigurationRevisionsResult listConfigurationRevisions(ListConfigurationRevisionsRequest request) {request = beforeClientExecution(request);return executeListConfigurationRevisions(request);}

// Translation:
public virtual ListConfigurationRevisionsResponse ListConfigurationRevisions(ListConfigurationRevisionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListConfigurationRevisionsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListConfigurationRevisionsResponseUnmarshaller.Instance;return Invoke<ListConfigurationRevisionsResponse>(request, options);}
// Original:
public ObjectStream openStream() {return new ObjectStream.SmallStream(this);}

// Translation:
public override ObjectStream OpenStream(){return new ObjectStream.SmallStream(this);}
// Original:
public boolean delete() {return directory.delete();}

// Translation:
public bool Delete(){return directory.Delete();}
// Original:
public void clear(){_limit = 0;}

// Translation:
public void Clear(){_limit = 0;}
// Original:
public void setMaxObjectSizeLimit(long limit) {maxObjectSizeLimit = limit;}

// Translation:
public virtual void SetMaxObjectSizeLimit(long limit){maxObjectSizeLimit = limit;}
// Original:
public DescribeEventSubscriptionsResult describeEventSubscriptions(DescribeEventSubscriptionsRequest request) {request = beforeClientExecution(request);return executeDescribeEventSubscriptions(request);}

// Translation:
public virtual DescribeEventSubscriptionsResponse DescribeEventSubscriptions(DescribeEventSubscriptionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeEventSubscriptionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeEventSubscriptionsResponseUnmarshaller.Instance;return Invoke<DescribeEventSubscriptionsResponse>(request, options);}
// Original:
public boolean startEvaluate(FormulaCellCacheEntry cce) {if (cce == null) {throw new IllegalArgumentException("cellLoc must not be null");}if (_currentlyEvaluatingCells.contains(cce)) {return false;}_currentlyEvaluatingCells.add(cce);_evaluationFrames.add(new CellEvaluationFrame(cce));return true;}

// Translation:
public bool StartEvaluate(FormulaCellCacheEntry cce){if (cce == null){throw new ArgumentException("cellLoc must not be null");}if (_currentlyEvaluatingCells.Contains(cce)){return false;}_currentlyEvaluatingCells.Add(cce);_evaluationFrames.Add(new CellEvaluationFrame(cce));return true;}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(sid);out.writeShort(_cbFContinued);if (_linkPtg == null) {out.writeShort(0);} else {int formulaSize = _linkPtg.getSize();int linkSize = formulaSize + 6;if (_unknownPostFormulaByte != null) {linkSize++;}out.writeShort(linkSize);out.writeShort(formulaSize);out.writeInt(_unknownPreFormulaInt);_linkPtg.write(out);if (_unknownPostFormulaByte != null) {out.writeByte(_unknownPostFormulaByte.intValue());}}out.writeShort(_cLines);out.writeShort(_iSel);out.writeShort(_flags);out.writeShort(_idEdit);if(_dropData != null) {_dropData.serialize(out);}if(_rgLines != null) {for(String str : _rgLines){StringUtil.writeUnicodeString(out, str);}}if(_bsels != null) {for(boolean val : _bsels){out.writeByte(val ? 1 : 0);}}}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(sid);out1.WriteShort(_cbFContinued); if (_linkPtg == null){out1.WriteShort(0);}else{int formulaSize = _linkPtg.Size;int linkSize = formulaSize + 6;if (_unknownPostFormulaByte != null){linkSize++;}out1.WriteShort(linkSize);out1.WriteShort(formulaSize);out1.WriteInt(_unknownPreFormulaInt);_linkPtg.Write(out1);if (_unknownPostFormulaByte != null){out1.WriteByte(Convert.ToByte(_unknownPostFormulaByte, CultureInfo.InvariantCulture));}}out1.WriteShort(_cLines);out1.WriteShort(_iSel);out1.WriteShort(_flags);out1.WriteShort(_idEdit);if (_dropData != null){_dropData.Serialize(out1);}if (_rgLines != null){foreach (String str in _rgLines){StringUtil.WriteUnicodeString(out1, str);}}if (_bsels != null){foreach (bool val in _bsels){out1.WriteByte(val ? 1 : 0);}}}
// Original:
public void remove(int el) {if ( readonly ) throw new IllegalStateException("can't alter readonly IntervalSet");int n = intervals.size();for (int i = 0; i < n; i++) {Interval I = intervals.get(i);int a = I.a;int b = I.b;if ( el<a ) {break; }if ( el==a && el==b ) {intervals.remove(i);break;}if ( el==a ) {I.a++;break;}if ( el==b ) {I.b--;break;}if ( el>a && el<b ) { int oldb = I.b;I.b = el-1;      add(el+1, oldb); }}}

// Translation:
public virtual void Remove(int el){if (@readonly){throw new InvalidOperationException("can't alter readonly IntervalSet");}int n = intervals.Count;for (int i = 0; i < n; i++){Interval I = intervals[i];int a = I.a;int b = I.b;if (el < a){break;}if (el == a && el == b){intervals.RemoveAt(i);break;}if (el == a){intervals[i] = Interval.Of(I.a + 1, I.b);break;}if (el == b){intervals[i] = Interval.Of(I.a, I.b - 1);break;}if (el > a && el < b){int oldb = I.b;intervals[i] = Interval.Of(I.a, el - 1);Add(el + 1, oldb);}}}
// Original:
public IntegerList toIntegerList() {IntegerList values = new IntegerList(size());int n = intervals.size();for (int i = 0; i < n; i++) {Interval I = intervals.get(i);int a = I.a;int b = I.b;for (int v=a; v<=b; v++) {values.add(v);}}return values;}

// Translation:
public virtual ArrayList<int> ToIntegerList(){ArrayList<int> values = new ArrayList<int>(Count);int n = intervals.Count;for (int i = 0; i < n; i++){Interval I = intervals[i];int a = I.a;int b = I.b;for (int v = a; v <= b; v++){values.Add(v);}}return values;}
// Original:
@Override public void clear() {AbstractMultimap.this.clear();}

// Translation:
public override void clear(){this._enclosing.clear();}
// Original:
public CharsRef pullNext() {assert upto < count;lastEndOffset = endOffsets[upto];lastPosLength = posLengths[upto];final CharsRefBuilder result = outputs[upto++];posIncr = 0;if (upto == count) {reset();}return result.get();}

// Translation:
public virtual CharsRef PullNext(){Debug.Assert(upto < count);lastEndOffset = endOffsets[upto];lastPosLength = posLengths[upto];CharsRef result = outputs[upto++];posIncr = 0;if (upto == count){Reset();}return result;}
// Original:
public FSTTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter) throws IOException {final String termsFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_EXTENSION);this.postingsWriter = postingsWriter;this.fieldInfos = state.fieldInfos;this.out = state.directory.createOutput(termsFileName, state.context);this.maxDoc = state.segmentInfo.maxDoc();boolean success = false;try {CodecUtil.writeIndexHeader(out, TERMS_CODEC_NAME, TERMS_VERSION_CURRENT,state.segmentInfo.getId(), state.segmentSuffix);this.postingsWriter.init(out, state);success = true;} finally {if (!success) {IOUtils.closeWhileHandlingException(out);}}}

// Translation:
public FSTTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter){var termsFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix,TERMS_EXTENSION);_postingsWriter = postingsWriter;_fieldInfos = state.FieldInfos;_output = state.Directory.CreateOutput(termsFileName, state.Context);var success = false;try{WriteHeader(_output);_postingsWriter.Init(_output);success = true;}finally{if (!success){IOUtils.DisposeWhileHandlingException(_output);}}}
// Original:
public int compareTo(Cell other) {return Double.compare(distanceSortKey, other.distanceSortKey);}

// Translation:
public virtual int CompareTo(Cell o){return string.CompareOrdinal(TokenString, o.TokenString);}
// Original:
public ListAccountSettingsResult listAccountSettings(ListAccountSettingsRequest request) {request = beforeClientExecution(request);return executeListAccountSettings(request);}

// Translation:
public virtual ListAccountSettingsResponse ListAccountSettings(ListAccountSettingsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListAccountSettingsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListAccountSettingsResponseUnmarshaller.Instance;return Invoke<ListAccountSettingsResponse>(request, options);}
// Original:
public boolean find() {matchFound = findNextImpl(address, input, matchOffsets);if (matchFound) {findPos = matchOffsets[1];}return matchFound;}

// Translation:
public bool find(){matchFound = findNextImpl(address, input, matchOffsets);if (matchFound){findPos = matchOffsets[1];}return matchFound;}
// Original:
public V next()        { return super.nextEntry().value; }

// Translation:
public override V next(){return this.nextEntry().value;}
// Original:
public DescribeLocalGatewaysResult describeLocalGateways(DescribeLocalGatewaysRequest request) {request = beforeClientExecution(request);return executeDescribeLocalGateways(request);}

// Translation:
public virtual DescribeLocalGatewaysResponse DescribeLocalGateways(DescribeLocalGatewaysRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeLocalGatewaysRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeLocalGatewaysResponseUnmarshaller.Instance;return Invoke<DescribeLocalGatewaysResponse>(request, options);}
// Original:
public ByteArrayDataInput(byte[] bytes, int offset, int len) {reset(bytes, offset, len);}

// Translation:
public ByteArrayDataInput(byte[] bytes, int offset, int len){Reset(bytes, offset, len);}
// Original:
public String toString() {return super.toString() + ":" + revstr; }

// Translation:
public override string ToString(){return base.ToString() + ":" + revstr;}
// Original:
public RegisterCrossAccountAccessRoleResult registerCrossAccountAccessRole(RegisterCrossAccountAccessRoleRequest request) {request = beforeClientExecution(request);return executeRegisterCrossAccountAccessRole(request);}

// Translation:
public virtual RegisterCrossAccountAccessRoleResponse RegisterCrossAccountAccessRole(RegisterCrossAccountAccessRoleRequest request){var options = new InvokeOptions();options.RequestMarshaller = RegisterCrossAccountAccessRoleRequestMarshaller.Instance;options.ResponseUnmarshaller = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance;return Invoke<RegisterCrossAccountAccessRoleResponse>(request, options);}
// Original:
public void clear() {ConcurrentHashMap.this.clear();}

// Translation:
public override void clear(){this._enclosing.clear();}
// Original:
public DescribeFileSystemsResult describeFileSystems(DescribeFileSystemsRequest request) {request = beforeClientExecution(request);return executeDescribeFileSystems(request);}

// Translation:
public virtual DescribeFileSystemsResponse DescribeFileSystems(DescribeFileSystemsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeFileSystemsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeFileSystemsResponseUnmarshaller.Instance;return Invoke<DescribeFileSystemsResponse>(request, options);}
// Original:
public ReverseStringFilterFactory(Map<String,String> args) {super(args);if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}

// Translation:
public ReverseStringFilterFactory(IDictionary<string, string> args) : base(args){AssureMatchVersion();if (args.Count > 0){throw new System.ArgumentException("Unknown parameters: " + args);}}
// Original:
public Builder() {this(true);}

// Translation:
public Builder(){InitializeInstanceFields();}
// Original:
public TokenStream create(TokenStream input) {return new IrishLowerCaseFilter(input);}

// Translation:
public override TokenStream Create(TokenStream input){return new IrishLowerCaseFilter(input);}
// Original:
public GetQualificationTypeResult getQualificationType(GetQualificationTypeRequest request) {request = beforeClientExecution(request);return executeGetQualificationType(request);}

// Translation:
public virtual GetQualificationTypeResponse GetQualificationType(GetQualificationTypeRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetQualificationTypeRequestMarshaller.Instance;options.ResponseUnmarshaller = GetQualificationTypeResponseUnmarshaller.Instance;return Invoke<GetQualificationTypeResponse>(request, options);}
// Original:
public ThreeWayMerger newMerger(Repository db, boolean inCore) {return new ResolveMerger(db, inCore);}

// Translation:
public override Merger NewMerger(Repository db, bool inCore){return new ResolveMerger(db, inCore);}
// Original:
public String getNameText(int definedNameIndex) {return _externalNameRecords[definedNameIndex].getText();}

// Translation:
public String GetNameText(int definedNameIndex){return _externalNameRecords[definedNameIndex].Text;}
// Original:
public PlotWalk(Repository repo) {super(repo);super.sort(RevSort.TOPO, true);additionalRefMap = new HashMap<>();repository = repo;}

// Translation:
public PlotWalk(Repository repo) : base(repo){base.Sort(RevSort.TOPO, true);reverseRefMap = repo.GetAllRefsByPeeledObjectId();}
// Original:
public SubscribeToDatasetResult subscribeToDataset(SubscribeToDatasetRequest request) {request = beforeClientExecution(request);return executeSubscribeToDataset(request);}

// Translation:
public virtual SubscribeToDatasetResponse SubscribeToDataset(SubscribeToDatasetRequest request){var options = new InvokeOptions();options.RequestMarshaller = SubscribeToDatasetRequestMarshaller.Instance;options.ResponseUnmarshaller = SubscribeToDatasetResponseUnmarshaller.Instance;return Invoke<SubscribeToDatasetResponse>(request, options);}
// Original:
public StringBuilder append(char[] str, int offset, int len) {append0(str, offset, len);return this;}

// Translation:
public java.lang.StringBuilder append(char[] str, int offset, int len){append0(str, offset, len);return this;}
// Original:
public synchronized int indexOf(String subString, int start) {return super.indexOf(subString, start);}

// Translation:
public override int indexOf(string subString, int start){lock (this){return base.indexOf(subString, start);}}
// Original:
public List<E> subList(int from, int to) {Object[] snapshot = elements;if (from < 0 || from > to || to > snapshot.length) {throw new IndexOutOfBoundsException("from=" + from + ", to=" + to +", list size=" + snapshot.length);}return new CowSubList(snapshot, from, to);}

// Translation:
public virtual java.util.List<E> subList(int from, int to){object[] snapshot = elements;if (from < 0 || from > to || to > snapshot.Length){throw new System.IndexOutOfRangeException("from=" + from + ", to=" + to + ", list size="+ snapshot.Length);}return new java.util.concurrent.CopyOnWriteArrayList<E>.CowSubList(this, snapshot, from, to);}
// Original:
public Severity getSeverity() {return severity;}

// Translation:
public virtual FormatError.Severity GetSeverity(){return severity;}
// Original:
public DescribeBundleTasksResult describeBundleTasks() {return describeBundleTasks(new DescribeBundleTasksRequest());}

// Translation:
public virtual DescribeBundleTasksResponse DescribeBundleTasks(){return DescribeBundleTasks(new DescribeBundleTasksRequest());}
// Original:
public BooleanQuery build() {return new BooleanQuery(minimumNumberShouldMatch, clauses.toArray(new BooleanClause[0]));}

// Translation:
public CompositeReaderContext Build(){return (CompositeReaderContext)Build(null, reader, 0, 0);}
// Original:
public String toString(){StringBuilder buffer = new StringBuilder();buffer.append("[HIDEOBJ]\n");buffer.append("    .hideobj         = ").append(Integer.toHexString(getHideObj())).append("\n");buffer.append("[/HIDEOBJ]\n");return buffer.toString();}

// Translation:
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[HIDEOBJ]\n");buffer.Append("    .hideobj         = ").Append(StringUtil.ToHexString(GetHideObj())).Append("\n");buffer.Append("[/HIDEOBJ]\n");return buffer.ToString();}
// Original:
public UseSelFSRecord(boolean b) {this(0);_options = useNaturalLanguageFormulasFlag.setBoolean(_options, b);}

// Translation:
public UseSelFSRecord(int options){_options = options;}
// Original:
public boolean equals( Object o ) {return o instanceof RomanianStemmer;}

// Translation:
public override bool Equals(object o){return o is RomanianStemmer;}
// Original:
public AbortMultipartUploadResult abortMultipartUpload(AbortMultipartUploadRequest request) {request = beforeClientExecution(request);return executeAbortMultipartUpload(request);}

// Translation:
public virtual AbortMultipartUploadResponse AbortMultipartUpload(AbortMultipartUploadRequest request){var options = new InvokeOptions();options.RequestMarshaller = AbortMultipartUploadRequestMarshaller.Instance;options.ResponseUnmarshaller = AbortMultipartUploadResponseUnmarshaller.Instance;return Invoke<AbortMultipartUploadResponse>(request, options);}
// Original:
public void reportMatch(Parser recognizer) {endErrorCondition(recognizer);}

// Translation:
public virtual void ReportMatch(Parser recognizer){EndErrorCondition(recognizer);}
// Original:
public ModifyVpnConnectionResult modifyVpnConnection(ModifyVpnConnectionRequest request) {request = beforeClientExecution(request);return executeModifyVpnConnection(request);}

// Translation:
public virtual ModifyVpnConnectionResponse ModifyVpnConnection(ModifyVpnConnectionRequest request){var options = new InvokeOptions();options.RequestMarshaller = ModifyVpnConnectionRequestMarshaller.Instance;options.ResponseUnmarshaller = ModifyVpnConnectionResponseUnmarshaller.Instance;return Invoke<ModifyVpnConnectionResponse>(request, options);}
// Original:
public GetSendStatisticsResult getSendStatistics() {return getSendStatistics(new GetSendStatisticsRequest());}

// Translation:
public virtual GetSendStatisticsResponse GetSendStatistics(){return GetSendStatistics(new GetSendStatisticsRequest());}
// Original:
public CreateVoiceConnectorGroupResult createVoiceConnectorGroup(CreateVoiceConnectorGroupRequest request) {request = beforeClientExecution(request);return executeCreateVoiceConnectorGroup(request);}

// Translation:
public virtual CreateVoiceConnectorGroupResponse CreateVoiceConnectorGroup(CreateVoiceConnectorGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateVoiceConnectorGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateVoiceConnectorGroupResponseUnmarshaller.Instance;return Invoke<CreateVoiceConnectorGroupResponse>(request, options);}
// Original:
public InitiateJobRequest(String vaultName, JobParameters jobParameters) {setVaultName(vaultName);setJobParameters(jobParameters);}

// Translation:
public InitiateJobRequest(string vaultName, JobParameters jobParameters){_vaultName = vaultName;_jobParameters = jobParameters;}
// Original:
public MatchResult toMatchResult() {ensureMatch();return new MatchResultImpl(input, matchOffsets);}

// Translation:
public java.util.regex.MatchResult toMatchResult(){ensureMatch();return new java.util.regex.MatchResultImpl(input, matchOffsets);}
// Original:
public static String getInflectedFormTranslation(String s) {return inflFormTranslations.get(s);}

// Translation:
public static string GetInflectedFormTranslation(string s){string result;inflFormTranslations.TryGetValue(s, out result);return result;}
// Original:
public static ErrPtg valueOf(int code) {switch(FormulaError.forInt(code)) {case DIV0: return DIV_ZERO;case NA: return N_A;case NAME: return NAME_INVALID;case NULL: return NULL_INTERSECTION;case NUM: return NUM_ERROR;case REF: return REF_INVALID;case VALUE: return VALUE_INVALID;default:throw new RuntimeException("Unexpected error code (" + code + ")");}}

// Translation:
public static ErrPtg ValueOf(int code){switch (code){case HSSFErrorConstants.ERROR_DIV_0: return DIV_ZERO;case HSSFErrorConstants.ERROR_NA: return N_A;case HSSFErrorConstants.ERROR_NAME: return NAME_INVALID;case HSSFErrorConstants.ERROR_NULL: return NULL_INTERSECTION;case HSSFErrorConstants.ERROR_NUM: return NUM_ERROR;case HSSFErrorConstants.ERROR_REF: return REF_INVALID;case HSSFErrorConstants.ERROR_VALUE: return VALUE_INVALID;}throw new InvalidOperationException("Unexpected error code (" + code + ")");}