yijunyu/c-to-rust huggingface dataset:
// Original:
public synchronized void publish(Revision revision) throws IOException {ensureOpen();if (currentRevision != null) {int compare = revision.compareTo(currentRevision.revision);if (compare == 0) {revision.release();return;}if (compare < 0) {revision.release();throw new IllegalArgumentException("Cannot publish an older revision: rev=" + revision + " current="+ currentRevision);}}final RefCountedRevision oldRevision = currentRevision;currentRevision = new RefCountedRevision(revision);if (oldRevision != null) {oldRevision.decRef();}checkExpiredSessions();}

// Translation:
public virtual void Publish(IRevision revision){lock (padlock){EnsureOpen();if (currentRevision != null){int compare = revision.CompareTo(currentRevision.Revision);if (compare == 0){revision.Release();return;}if (compare < 0){revision.Release();throw new ArgumentException(string.Format("Cannot publish an older revision: rev={0} current={1}", revision, currentRevision), "revision");}}RefCountedRevision oldRevision = currentRevision;currentRevision = new RefCountedRevision(revision);if (oldRevision != null)oldRevision.DecRef();CheckExpiredSessions();}}
// Original:
public final boolean equals(AnyObjectId other) {return other != null ? isEqual(this, other) : false;}

// Translation:
public bool Equals(AnyObjectId other){return other != null ? Equals(this, other) : false;}
// Original:
public DeleteBGPPeerResult deleteBGPPeer(DeleteBGPPeerRequest request) {request = beforeClientExecution(request);return executeDeleteBGPPeer(request);}

// Translation:
public virtual DeleteBGPPeerResponse DeleteBGPPeer(DeleteBGPPeerRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteBGPPeerRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteBGPPeerResponseUnmarshaller.Instance;return Invoke<DeleteBGPPeerResponse>(request, options);}
// Original:
public String toString() {return "I(n)";}

// Translation:
public override string ToString(){return "I(n)";}
// Original:
public DeleteVpcPeeringConnectionResult deleteVpcPeeringConnection(DeleteVpcPeeringConnectionRequest request) {request = beforeClientExecution(request);return executeDeleteVpcPeeringConnection(request);}

// Translation:
public virtual DeleteVpcPeeringConnectionResponse DeleteVpcPeeringConnection(DeleteVpcPeeringConnectionRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteVpcPeeringConnectionRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteVpcPeeringConnectionResponseUnmarshaller.Instance;return Invoke<DeleteVpcPeeringConnectionResponse>(request, options);}
// Original:
public UpdateIdentityPoolResult updateIdentityPool(UpdateIdentityPoolRequest request) {request = beforeClientExecution(request);return executeUpdateIdentityPool(request);}

// Translation:
public virtual UpdateIdentityPoolResponse UpdateIdentityPool(UpdateIdentityPoolRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateIdentityPoolRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateIdentityPoolResponseUnmarshaller.Instance;return Invoke<UpdateIdentityPoolResponse>(request, options);}
// Original:
public String signString(String stringToSign, AlibabaCloudCredentials credentials) {return signString(stringToSign, credentials.getAccessKeySecret());}

// Translation:
public override string SignString(string stringToSign, AlibabaCloudCredentials credentials){return SignString(stringToSign, credentials.GetAccessKeySecret());}
// Original:
public GetDeviceResult getDevice(GetDeviceRequest request) {request = beforeClientExecution(request);return executeGetDevice(request);}

// Translation:
public virtual GetDeviceResponse GetDevice(GetDeviceRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetDeviceRequestMarshaller.Instance;options.ResponseUnmarshaller = GetDeviceResponseUnmarshaller.Instance;return Invoke<GetDeviceResponse>(request, options);}
// Original:
public void writeInt(int v) {writeContinueIfRequired(4);_ulrOutput.writeInt(v);}

// Translation:
public void WriteInt(int v){_out.WriteInt(v);_size += 4;}
// Original:
public boolean isSuccess() {return 200 <= this.status && this.status < 300;}

// Translation:
public bool isSuccess(){return 200 <= Status && 300 > Status;}
// Original:
public static CredentialsProvider getDefault() {return defaultProvider;}

// Translation:
public static CredentialsProvider GetDefault(){return defaultProvider;}
// Original:
public boolean equals(Object obj) {if (obj == this) {return true;}else if (!(obj instanceof LexerPushModeAction)) {return false;}return mode == ((LexerPushModeAction)obj).mode;}

// Translation:
public override bool Equals(object obj){if (obj == this){return true;}else{if (!(obj is Antlr4.Runtime.Atn.LexerPushModeAction)){return false;}}return mode == ((Antlr4.Runtime.Atn.LexerPushModeAction)obj).mode;}
// Original:
public void dumpDFA() {synchronized (_interp.decisionToDFA) {boolean seenOne = false;for (int d = 0; d < _interp.decisionToDFA.length; d++) {DFA dfa = _interp.decisionToDFA[d];if ( !dfa.states.isEmpty() ) {if ( seenOne ) System.out.println();System.out.println("Decision " + dfa.decision + ":");System.out.print(dfa.toString(getVocabulary()));seenOne = true;}}}}

// Translation:
public virtual void DumpDFA(){bool seenOne = false;for (int d = 0; d < Interpreter.decisionToDFA.Length; d++){DFA dfa = Interpreter.decisionToDFA[d];if (dfa.states.Count>0){if (seenOne){Output.WriteLine();}Output.WriteLine("Decision " + dfa.decision + ":");Output.Write(dfa.ToString(Vocabulary));seenOne = true;}}}
// Original:
public FloatBuffer put(int index, float c) {throw new ReadOnlyBufferException();}

// Translation:
public override java.nio.FloatBuffer put(int index, float c){throw new java.nio.ReadOnlyBufferException();}
// Original:
public CancelClusterResult cancelCluster(CancelClusterRequest request) {request = beforeClientExecution(request);return executeCancelCluster(request);}

// Translation:
public virtual CancelClusterResponse CancelCluster(CancelClusterRequest request){var options = new InvokeOptions();options.RequestMarshaller = CancelClusterRequestMarshaller.Instance;options.ResponseUnmarshaller = CancelClusterResponseUnmarshaller.Instance;return Invoke<CancelClusterResponse>(request, options);}
// Original:
public DeleteSnapshotResult deleteSnapshot(DeleteSnapshotRequest request) {request = beforeClientExecution(request);return executeDeleteSnapshot(request);}

// Translation:
public virtual DeleteSnapshotResponse DeleteSnapshot(DeleteSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteSnapshotResponseUnmarshaller.Instance;return Invoke<DeleteSnapshotResponse>(request, options);}
// Original:
public DeletePhoneNumberResult deletePhoneNumber(DeletePhoneNumberRequest request) {request = beforeClientExecution(request);return executeDeletePhoneNumber(request);}

// Translation:
public virtual DeletePhoneNumberResponse DeletePhoneNumber(DeletePhoneNumberRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeletePhoneNumberRequestMarshaller.Instance;options.ResponseUnmarshaller = DeletePhoneNumberResponseUnmarshaller.Instance;return Invoke<DeletePhoneNumberResponse>(request, options);}
// Original:
public boolean addPushURI(URIish toAdd) {if (pushURIs.contains(toAdd))return false;return pushURIs.add(toAdd);}

// Translation:
public virtual bool AddPushURI(URIish toAdd){if (pushURIs.Contains(toAdd)){return false;}return pushURIs.AddItem(toAdd);}
// Original:
public BytesRef next() throws IOException {boolean success = false;try {scratch = reader.next();if (scratch == null) {reader.close();}success = true;return scratch;} finally {if (!success) {IOUtils.closeWhileHandlingException(reader);}}}

// Translation:
public virtual BytesRef Next(){if (scratch == null){return null;}bool success = false;try{byte[] next = reader.Read();if (next != null){scratch.Bytes = next;scratch.Length = next.Length;scratch.Offset = 0;}else{IOUtils.Dispose(reader);scratch = null;}success = true;return scratch;}finally{if (!success){IOUtils.DisposeWhileHandlingException(reader);}}}
// Original:
public void removeCreateDateTime() {remove1stProperty(PropertyIDMap.PID_CREATE_DTM);}

// Translation:
public void RemoveCreateDateTime(){MutableSection s = (MutableSection)FirstSection;s.RemoveProperty(PropertyIDMap.PID_Create_DTM);}
// Original:
public CreateHealthCheckResult createHealthCheck(CreateHealthCheckRequest request) {request = beforeClientExecution(request);return executeCreateHealthCheck(request);}

// Translation:
public virtual CreateHealthCheckResponse CreateHealthCheck(CreateHealthCheckRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateHealthCheckRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateHealthCheckResponseUnmarshaller.Instance;return Invoke<CreateHealthCheckResponse>(request, options);}
// Original:
public EnableVgwRoutePropagationResult enableVgwRoutePropagation(EnableVgwRoutePropagationRequest request) {request = beforeClientExecution(request);return executeEnableVgwRoutePropagation(request);}

// Translation:
public virtual EnableVgwRoutePropagationResponse EnableVgwRoutePropagation(EnableVgwRoutePropagationRequest request){var options = new InvokeOptions();options.RequestMarshaller = EnableVgwRoutePropagationRequestMarshaller.Instance;options.ResponseUnmarshaller = EnableVgwRoutePropagationResponseUnmarshaller.Instance;return Invoke<EnableVgwRoutePropagationResponse>(request, options);}
// Original:
public void removeByteCount() {remove1stProperty(PropertyIDMap.PID_BYTECOUNT);}

// Translation:
public void RemoveByteCount(){MutableSection s = (MutableSection)FirstSection;s.RemoveProperty(PropertyIDMap.PID_BYTECOUNT);}
// Original:
public UpdateAutoScalingGroupResult updateAutoScalingGroup(UpdateAutoScalingGroupRequest request) {request = beforeClientExecution(request);return executeUpdateAutoScalingGroup(request);}

// Translation:
public virtual UpdateAutoScalingGroupResponse UpdateAutoScalingGroup(UpdateAutoScalingGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateAutoScalingGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateAutoScalingGroupResponseUnmarshaller.Instance;return Invoke<UpdateAutoScalingGroupResponse>(request, options);}
// Original:
public CreateNotebookInstanceResult createNotebookInstance(CreateNotebookInstanceRequest request) {request = beforeClientExecution(request);return executeCreateNotebookInstance(request);}

// Translation:
public virtual CreateNotebookInstanceResponse CreateNotebookInstance(CreateNotebookInstanceRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateNotebookInstanceRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateNotebookInstanceResponseUnmarshaller.Instance;return Invoke<CreateNotebookInstanceResponse>(request, options);}
// Original:
public AllocateAddressResult allocateAddress() {return allocateAddress(new AllocateAddressRequest());}

// Translation:
public virtual AllocateAddressResponse AllocateAddress(){return AllocateAddress(new AllocateAddressRequest());}
// Original:
public CreateMLModelResult createMLModel(CreateMLModelRequest request) {request = beforeClientExecution(request);return executeCreateMLModel(request);}

// Translation:
public virtual CreateMLModelResponse CreateMLModel(CreateMLModelRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateMLModelRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateMLModelResponseUnmarshaller.Instance;return Invoke<CreateMLModelResponse>(request, options);}
// Original:
public ContinueRecord(byte[] data) {_data = data.clone();}

// Translation:
public ContinueRecord(byte[] data){field_1_data = data;}
// Original:
public Parser getParser() {return parser;}

// Translation:
public Parser getParser(){return parser;}
// Original:
public DeleteSolutionResult deleteSolution(DeleteSolutionRequest request) {request = beforeClientExecution(request);return executeDeleteSolution(request);}

// Translation:
public virtual DeleteSolutionResponse DeleteSolution(DeleteSolutionRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteSolutionRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteSolutionResponseUnmarshaller.Instance;return Invoke<DeleteSolutionResponse>(request, options);}
// Original:
public boolean isDelete() {return ObjectId.zeroId().equals(newObjectId);}

// Translation:
public virtual bool IsDelete(){return ObjectId.ZeroId.Equals(newObjectId);}
// Original:
public int getNextPos() {return nextPos;}

// Translation:
public int GetNextPos(){return nextPos;}
// Original:
public DescribeSpotFleetInstancesResult describeSpotFleetInstances(DescribeSpotFleetInstancesRequest request) {request = beforeClientExecution(request);return executeDescribeSpotFleetInstances(request);}

// Translation:
public virtual DescribeSpotFleetInstancesResponse DescribeSpotFleetInstances(DescribeSpotFleetInstancesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeSpotFleetInstancesRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeSpotFleetInstancesResponseUnmarshaller.Instance;return Invoke<DescribeSpotFleetInstancesResponse>(request, options);}
// Original:
public ResetPasswordResult resetPassword(ResetPasswordRequest request) {request = beforeClientExecution(request);return executeResetPassword(request);}

// Translation:
public virtual ResetPasswordResponse ResetPassword(ResetPasswordRequest request){var options = new InvokeOptions();options.RequestMarshaller = ResetPasswordRequestMarshaller.Instance;options.ResponseUnmarshaller = ResetPasswordResponseUnmarshaller.Instance;return Invoke<ResetPasswordResponse>(request, options);}
// Original:
public String toString() {return "DrawingRecord["+recordData.length+"]";}

// Translation:
public override String ToString(){return "DrawingRecord[" + recordData.Length + "]";}
// Original:
public Status call() throws GitAPIException, NoWorkTreeException {if (workingTreeIt == null)workingTreeIt = new FileTreeIterator(repo);try {IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt);if (ignoreSubmoduleMode != null)diff.setIgnoreSubmoduleMode(ignoreSubmoduleMode);if (paths != null)diff.setFilter(PathFilterGroup.createFromStrings(paths));if (progressMonitor == null)diff.diff();elsediff.diff(progressMonitor, ProgressMonitor.UNKNOWN,ProgressMonitor.UNKNOWN, ""); return new Status(diff);} catch (IOException e) {throw new JGitInternalException(e.getMessage(), e);}}

// Translation:
public override Status Call(){if (workingTreeIt == null){workingTreeIt = new FileTreeIterator(repo);}try{IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt);diff.Diff();return new Status(diff);}catch (IOException e){throw new JGitInternalException(e.Message, e);}}
// Original:
public PathHierarchyTokenizerFactory(Map<String,String> args) {super(args);delimiter = getChar(args, "delimiter", PathHierarchyTokenizer.DEFAULT_DELIMITER);replacement = getChar(args, "replace", delimiter);reverse = getBoolean(args, "reverse", false);skip = getInt(args, "skip", PathHierarchyTokenizer.DEFAULT_SKIP);if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}

// Translation:
public PathHierarchyTokenizerFactory(IDictionary<string, string> args): base(args){delimiter = GetChar(args, "delimiter", PathHierarchyTokenizer.DEFAULT_DELIMITER);replacement = GetChar(args, "replace", delimiter);reverse = GetBoolean(args, "reverse", false);skip = GetInt32(args, "skip", PathHierarchyTokenizer.DEFAULT_SKIP);if (args.Count > 0){throw new System.ArgumentException("Unknown parameters: " + args);}}
// Original:
public String toString() {return super.toString() + ": " + lockName;}

// Translation:
public override string ToString(){return base.ToString() + ": " + lockName;}
// Original:
public CreateFieldLevelEncryptionConfigResult createFieldLevelEncryptionConfig(CreateFieldLevelEncryptionConfigRequest request) {request = beforeClientExecution(request);return executeCreateFieldLevelEncryptionConfig(request);}

// Translation:
public virtual CreateFieldLevelEncryptionConfigResponse CreateFieldLevelEncryptionConfig(CreateFieldLevelEncryptionConfigRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateFieldLevelEncryptionConfigRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateFieldLevelEncryptionConfigResponseUnmarshaller.Instance;return Invoke<CreateFieldLevelEncryptionConfigResponse>(request, options);}
// Original:
public Reader reader() {return reader;}

// Translation:
public java.io.Reader reader(){return _reader;}
// Original:
public DeleteHealthCheckResult deleteHealthCheck(DeleteHealthCheckRequest request) {request = beforeClientExecution(request);return executeDeleteHealthCheck(request);}

// Translation:
public virtual DeleteHealthCheckResponse DeleteHealthCheck(DeleteHealthCheckRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteHealthCheckRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteHealthCheckResponseUnmarshaller.Instance;return Invoke<DeleteHealthCheckResponse>(request, options);}
// Original:
public long get() {return count;}

// Translation:
public override long Get(){return count;}
// Original:
public int setArrayData(byte[] data, int offset) {if (emptyComplexPart) {resizeComplexData(0);} else {short numElements = LittleEndian.getShort(data, offset);short sizeOfElements = LittleEndian.getShort(data, offset + 4);int cdLen = getComplexData().length;int arraySize = getActualSizeOfElements(sizeOfElements) * numElements;if (arraySize == cdLen) {resizeComplexData(arraySize + 6, 0);sizeIncludesHeaderSize = false;}setComplexData(data, offset);}return getComplexData().length;}

// Translation:
public int SetArrayData(byte[] data, int offset){if (emptyComplexPart){_complexData = new byte[0];}else{short numElements = LittleEndian.GetShort(data, offset);short numReserved = LittleEndian.GetShort(data, offset + 2);short sizeOfElements = LittleEndian.GetShort(data, offset + 4);int arraySize = GetActualSizeOfElements(sizeOfElements) * numElements;if (arraySize == _complexData.Length){_complexData = new byte[arraySize + 6];sizeIncludesHeaderSize = false;}Array.Copy(data, offset, _complexData, 0, _complexData.Length);}return _complexData.Length;}
// Original:
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {TwoDEval reference = convertFirstArg(arg0);int columnIx = 0;try {int rowIx = resolveIndexArg(arg1, srcRowIndex, srcColumnIndex);if (!reference.isColumn()) {if (!reference.isRow()) {return ErrorEval.REF_INVALID;}columnIx = rowIx;rowIx = 0;}return getValueFromArea(reference, rowIx, columnIx);} catch (EvaluationException e) {return e.getErrorEval();}}

// Translation:
public ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1){TwoDEval reference = ConvertFirstArg(arg0);int columnIx = 0;try{int rowIx = ResolveIndexArg(arg1, srcRowIndex, srcColumnIndex);if (!reference.IsColumn){if (!reference.IsRow){return ErrorEval.REF_INVALID;}columnIx = rowIx;rowIx = 0;}return GetValueFromArea(reference, rowIx, columnIx);}catch (EvaluationException e){return e.GetErrorEval();}}
// Original:
public boolean seekExact(BytesRef term) throws IOException {throw new UnsupportedOperationException(getClass().getName()+" does not support seeking");}

// Translation:
public override bool SeekExact(BytesRef term){throw new System.NotSupportedException(this.GetType().Name + " does not support seeking");}
// Original:
public GetSmsTemplateResult getSmsTemplate(GetSmsTemplateRequest request) {request = beforeClientExecution(request);return executeGetSmsTemplate(request);}

// Translation:
public virtual GetSmsTemplateResponse GetSmsTemplate(GetSmsTemplateRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetSmsTemplateRequestMarshaller.Instance;options.ResponseUnmarshaller = GetSmsTemplateResponseUnmarshaller.Instance;return Invoke<GetSmsTemplateResponse>(request, options);}
// Original:
public String getFieldAsString() {if (this.field == null)return null;elsereturn this.field.toString();}

// Translation:
public virtual string GetFieldAsString(){if (this.m_field == null)return null;elsereturn this.m_field.ToString();}
// Original:
@Override public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {return IoBridge.read(fd, buffer, byteOffset, byteCount);}

// Translation:
public override int read(byte[] buffer, int byteOffset, int byteCount){throw new System.NotImplementedException();}
// Original:
public HSSFHyperlink createHyperlink(HyperlinkType type) {return new HSSFHyperlink(type);}

// Translation:
public NPOI.SS.UserModel.IHyperlink CreateHyperlink(HyperlinkType type){return new HSSFHyperlink(type);}
// Original:
public UpdateGlobalSettingsResult updateGlobalSettings(UpdateGlobalSettingsRequest request) {request = beforeClientExecution(request);return executeUpdateGlobalSettings(request);}

// Translation:
public virtual UpdateGlobalSettingsResponse UpdateGlobalSettings(UpdateGlobalSettingsRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateGlobalSettingsRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateGlobalSettingsResponseUnmarshaller.Instance;return Invoke<UpdateGlobalSettingsResponse>(request, options);}
// Original:
public static String segmentFileName(String segmentName, String segmentSuffix, String ext) {if (ext.length() > 0 || segmentSuffix.length() > 0) {assert !ext.startsWith(".");StringBuilder sb = new StringBuilder(segmentName.length() + 2 + segmentSuffix.length() + ext.length());sb.append(segmentName);if (segmentSuffix.length() > 0) {sb.append('_').append(segmentSuffix);}if (ext.length() > 0) {sb.append('.').append(ext);}return sb.toString();} else {return segmentName;}}

// Translation:
public static string SegmentFileName(string segmentName, string segmentSuffix, string ext){if (ext.Length > 0 || segmentSuffix.Length > 0){Debug.Assert(!ext.StartsWith(".", StringComparison.Ordinal));StringBuilder sb = new StringBuilder(segmentName.Length + 2 + segmentSuffix.Length + ext.Length);sb.Append(segmentName);if (segmentSuffix.Length > 0){sb.Append('_').Append(segmentSuffix);}if (ext.Length > 0){sb.Append('.').Append(ext);}return sb.ToString();}else{return segmentName;}}
// Original:
public static JGitText get() {return NLS.getBundleFor(JGitText.class);}

// Translation:
public static JGitText Get(){return NLS.GetBundleFor<JGitText>();}
// Original:
public void insert(String key, char val) {int len = key.length() + 1; if (freenode + len > eq.length) {redimNodeArrays(eq.length + BLOCK_SIZE);}char strkey[] = new char[len--];key.getChars(0, len, strkey, 0);strkey[len] = 0;root = insert(root, strkey, 0, val);}

// Translation:
public virtual void Insert(string key, char val){int len = key.Length + 1; if (m_freenode + len > m_eq.Length){RedimNodeArrays(m_eq.Length + BLOCK_SIZE);}char[] strkey = new char[len--];key.CopyTo(0, strkey, 0, len - 0);strkey[len] = (char)0;m_root = Insert(m_root, strkey, 0, val);}
// Original:
public NameRecord createBuiltInName(byte builtInName, int sheetNumber) {if (sheetNumber < 0 || sheetNumber+1 > Short.MAX_VALUE) {throw new IllegalArgumentException("Sheet number ["+sheetNumber+"]is not valid ");}NameRecord name = new NameRecord(builtInName, sheetNumber);if(linkTable.nameAlreadyExists(name)) {throw new RuntimeException("Builtin (" + builtInName+ ") already exists for sheet (" + sheetNumber + ")");}addName(name);return name;}

// Translation:
public NameRecord CreateBuiltInName(byte builtInName, int index){if (index == -1 || index + 1 > short.MaxValue)throw new ArgumentException("Index is not valid [" + index + "]");NameRecord name = new NameRecord(builtInName, (short)(index));AddName(name);return name;}