
202 S.W.3d 131 (2006)
PATRICK THURMOND
v.
HOWARD CARLTON, WARDEN.
No. E2005-01460-CCA-R3-HC.
Court of Criminal Appeals of Tennessee, at Knoxville.
Assigned on Briefs December 13, 2005.
Filed April 4, 2006.
Patrick Thurmond, Mountain City, Tennessee, Pro Se.
Paul G. Summers, Attorney General and Reporter; Blind Akrawi, Assistant Attorney General; and Joe C. Crumley, Jr., District Attorney General, for the appellee, Howard Carlton, Warden.
Joseph M. Tipton, J., delivered the opinion of the court, in which David G. Hayes and James Curwood Witt, Jr., JJ., joined.

OPINION
JOSEPH M. TIPTON, JUDGE.
The petitioner, Patrick Thurmond, appeals pro se from the Johnson County Criminal Court's dismissal of his petition for habeas corpus relief from his convictions for one count of aggravated burglary, two counts of aggravated rape, one count of attempted aggravated rape, and one count of aggravated sexual battery and effective sentence of fifty years. The petitioner claims (1) that his sentences for attempted aggravated rape and aggravated sexual battery are illegal because the offenses are not subject to the multiple rapist classification under Tennessee Code Annotated section 39-13-523, (2) that his judgments of conviction are void on the two counts of aggravated rape and attempted aggravated rape because his classification as a multiple rapist is an enhanced punishment that was not charged in the indictment as required by Tennessee Code Annotated section 40-35-203(e), and (3) that the trial court violated Tennessee Code Annotated section 29-21-108(b) in failing to grant a writ. We conclude that the sentences for attempted aggravated rape and aggravated sexual battery are illegal. We affirm the trial court's judgment in part, reverse the judgment in part, and remand the case.
This case relates to the petitioner's convictions by a Davidson County Criminal Court jury for two counts of aggravated rape, one count of attempted aggravated rape, one count of aggravated sexual battery, and one count of aggravated burglary. The petitioner was sentenced as a multiple rapist to twenty years on each aggravated rape count, ten years for the attempted aggravated rape count, and ten years for the aggravated sexual battery count, and as a Range I, standard offender to three years for the aggravated burglary count. The trial court ordered the aggravated rape and attempted aggravated rape sentences to run consecutively and the aggravated sexual battery and aggravated burglary sentences to run concurrently for an effective sentence of fifty years in confinement. The petitioner filed a direct appeal, and this court affirmed his conviction. See State v. Patrick Thurmond, No. 01C01-9802-CR-00076, Davidson County, (Tenn. Crim. App. Oct. 5, 1999). The petitioner filed a petition for post-conviction relief which the trial court denied. The petitioner appealed the denial to this court. See Patrick Thurmond v. State, M2005-00214-CCA-R3-PC, Davidson County (Tenn. Crim. App. Mar. 15, 2006). On March 11, 2005, the petitioner filed a petition for habeas corpus relief alleging his judgments of conviction were void. The trial court summarily dismissed the petition, stating, "[T]he court finds that the petitioner has not presented a cognizable claim for Habeas Corpus relief." The petitioner filed this appeal.
Initially, we note that any relief to which a petitioner is entitled through exercise of the writ of habeas corpus is likewise attainable through the appellate process. See State ex rel. Danny Owens v. A.C. Gilless, No. 02C01-9108-CR-00174, Shelby County, slip op. at 7-8 (Tenn. Crim. App. Oct. 21, 1992). A habeas corpus or post-conviction petition may not be maintained while a direct appeal attacking the original conviction and sentence is pending in the appellate court. Hankins v. State, 512 S.W.2d 591, 592 (Tenn. Crim. App. 1974). On direct appeal, the petitioner challenged his consecutive sentences and could have challenged his classification as a multiple rapist at that time. Additionally, the petitioner could have raised all the issues regarding void sentences or convictions in his petition for post-conviction relief, rather than filing a petition for habeas corpus relief while his petition for post-conviction relief was still pending. See T.C.A. § 40-30-103. We note that if this court had granted post-conviction relief and reversed the petitioner's convictions, his petition for habeas corpus relief would have been moot. However, because habeas corpus petitions may be brought at anytime and because habeas corpus petitions and post-conviction petitions are "theoretically and statutorily distinct," we will address the issues raised by the petitioner in his petition for habeas corpus relief. See Archer v. State, 851 S.W.2d 157, 164 (Tenn. 1993) (stating that in accordance with article I, section 15 of the Tennessee Constitution, a petition for habeas corpus may be brought at anytime while the petitioner is incarcerated to contest a void judgment); Potts v. State, 833 S.W.2d 60, 62 (Tenn. 1992) (explaining the distinctions between habeas corpus and post-conviction relief).
The petitioner contends that the trial court erred by summarily dismissing his petition and that his sentences for the aggravated rapes, attempted aggravated rape, and aggravated sexual battery are void. He claims that the multiple rapist classification does not apply to the attempted aggravated rape or aggravated sexual battery and that the judgments are in direct contravention of Tennessee Code Annotated section 39-13-523. He claims the aggravated rape and attempted aggravated rape sentences are in direct violation of Tennessee Code Annotated section 40-35-203(e) because the indictments did not charge the defendant as a multiple rapist and the jury did not find the petitioner was a multiple rapist. He claims the trial court violated Tennessee Code Annotated section 29-21-108(b) in failing to grant a writ of habeas corpus.
The state asserts that the petitioner was properly classified as a multiple rapist. The state concedes aggravated sexual battery is not covered under the definition of "multiple rapist" but asserts the error does not entitle the petitioner to habeas corpus relief. The state asserts the illegal judgment may be corrected by the sentencing court at anytime. The state asserts the trial court properly applied the law in sentencing the petitioner as a multiple rapist for the aggravated rapes and attempted aggravated rape. The state asserts a separate indictment for a second or subsequent violation of the same offense was not required for application of the multiple rapist statute. It asserts the multiple rapist classification under Tennessee Code Annotated section 39-13-523(a)(2) limits the petitioner's parole eligibility and does not limit the power of the court to impose a particular sentence.
The trial court may summarily dismiss a petition for writ of habeas corpus relief when the petitioner does not state a cognizable claim. Hickman v. State, 153 S.W.3d 16, 20 (Tenn. 2004). A petition for the writ of habeas corpus may only be brought if the judgment is void or the sentence has expired. Archer v. State, 851 S.W.2d 157, 163-64 (Tenn. 1993). However, if the claimed illegality renders the judgment or sentence voidable, rather than void, no relief can be granted. Id. at 161. A sentence imposed in direct contravention of a statute is illegal and void. Stephenson v. Carlton, 28 S.W.3d 910, 911 (Tenn. 2000). A trial court may correct an illegal sentence at any time, even if it has become final. State v. Burkhart, 566 S.W.2d 871, 873 (Tenn. 1978). The determination of whether relief should be granted is a question of law which this court reviews de novo. Hart v. State, 21 S.W.3d 901, 903 (Tenn. 2000).

I. MULTIPLE RAPIST CLASSIFICATION
The petitioner contends that the trial court improperly sentenced him as a multiple rapist on his attempted aggravated rape and the aggravated sexual battery convictions because Tennessee Code Annotated section 39-13-523 applies only to aggravated rape or rape convictions. The petitioner asserts that his judgments on these two counts are illegal and that the trial court erred in denying him relief. The state concedes that aggravated sexual battery is not covered under the definition of "multiple rapist." The state asserts the petitioner is not entitled to habeas corpus relief because the petitioner's sentence was entered pursuant to a jury trial, and the trial court can correct an illegal judgment at any time.
Tennessee Code Annotated section 39-13-523(a)(2) states
"Multiple rapist" means a person convicted two (2) or more times of violating the provisions of § 39-13-502 [aggravated rape] or § 39-13-503 [rape], or a person convicted at least one (1) time of violating § 39-13-502, and at least one (1) time of § 39-13-503.
Classification as a multiple rapist requires that the defendant "serve the entire sentence imposed by the court undiminished by any sentence reduction credits such person may be eligible for or earn." T.C.A. § 39-13-523(b). The statute requires that at least one of the required offenses occur on or after July 1, 1992. See T.C.A. § 39-13-523 (e); State v. Johnson, 970 S.W.2d 500, 505 (Tenn. Crim. App. 1996).
The petitioner was convicted of two counts of aggravated rape, both occurring after the enactment of the multiple rapist statute. The petitioner also has an additional prior rape conviction as noted in his direct appeal and in his appeal for post-conviction relief. See Thurmond v. State, slip op. at 5; State v. Thurmond, slip op. at 15; see also Helton v. State, 530 S.W.2d 781, 783 (Tenn. Crim. App. 1975) (stating this court may take judicial notice of the petitioner's direct appeal). The petitioner qualifies as a multiple rapist, and his classification does not result in void judgments for the two counts of aggravated rape. However, the petitioner's classification as a multiple rapist for the attempted aggravated rape sentence and aggravated sexual battery are in direct contravention of Tennessee Code Annotated section 39-13-523(a)(2).
"Normally, it is a rule of statutory construction which is well recognized by our courts, that the mention of one subject in a statute means the exclusion of other subjects that are not mentioned." State v. Harkins, 811 S.W.2d 79, 82 (Tenn. 1991). Tennessee Code Annotated section 39-13-523 (a)(2) expressly incorporates aggravated rape and rape only. Therefore, the classification as a multiple rapist is inapplicable to the offenses of attempted aggravated rape or aggravated sexual battery. Cf. Kevin Shawn Taylor v. State, No. M2001-02203-CCA-R3-PC, Warren County, slip op. at 7 (Tenn. Crim. App. Sept. 26, 2002) (stating that attempted aggravated sexual battery was neither covered by a statute requiring no release eligibility for aggravated sexual battery nor by another statute's classification of a child rapist because the statute required a conviction for rape of a child).
We conclude that the judgments for the attempted aggravated rape and the aggravated sexual battery convictions are in direct contravention of statute and void because the petitioner could not be classified as a multiple rapist for those offenses. We remand this case to the Johnson County Criminal Court to vacate the petitioner's attempted aggravated rape and aggravated sexual battery sentences in counts four and five of case number 95-B-1027. The trial court should transfer the matter to the Davidson County Criminal Court, as the convicting court, for the determination of the petitioner's appropriate offender classification for the attempted aggravated rape and aggravated sexual battery convictions and for the entry of corrected judgments.

II. SEPARATE INDICTMENT FOR MULTIPLE RAPIST CLASSIFICATION
The petitioner contends that his sentences for aggravated rape and attempted aggravated rape are in direct violation of Tennessee Code Annotated section 40-35-203(e). The petitioner asserts the trial court lacked authority to impose an enhanced sentence because there were no separate indictments charging the petitioner as a multiple rapist or a jury finding that the petitioner was a multiple rapist. The state asserts the multiple rapist classification under Tennessee Code Annotated section 39-13-523(a)(2) limits the petitioner's parole eligibility and does not limit the power of the court to impose a particular sentence under Tennessee Code Annotated section 40-35-203(e).
Tennessee Code Annotated section 40-35-203(e) addresses the procedure for the trial court's imposition of a sentence. It states
If the criminal offense for which the defendant is charged carries an enhanced punishment for a second or subsequent violation of the same offense, the indictment in a separate count shall specify and charge such fact. If the defendant is convicted of the offense, then the jury must find that beyond a reasonable doubt the defendant has been previously convicted the requisite number of times for the same offense. Upon such finding, the defendant shall be subject to the authorized terms of imprisonment for the felonies and misdemeanors as set forth in § 40-35-111.
T.C.A. § 40-35-203(e). This section refers to section 40-35-111, which outlines the authorized terms of imprisonment and fines for felonies and misdemeanors. The multiple rapist classification statute addresses release eligibility of a defendant who is classified as a multiple rapist. Therefore, Tennessee Code Annotated sections 39-13-523 and 40-35-203(e) deal with two different types of sentence enhancements. Andre Lamont Mayfield v. State, No. M2004-01408-CCA-R3-HC, Davidson County, slip op. at 3 (Tenn. Crim. App. July 18, 2005) (discussing the difference between Tennessee Code Annotated sections 39-13-523 and 40-35-203(e) and stating they deal with two types of enhancements).
Tennessee Code Annotated section 39-13-523 does not require the multiple rapist classification for parole eligibility purposes to be included in the indictment. The classification as a multiple rapist is automatic and is not left to the discretion of the trial court or the prosecutor. See Andre L. Mayfield v. State, No. E2005-00138-CCA-R3-HC, Johnson County, slip op. at 5 (Tenn. Crim. App. July 29, 2005) (stating the multiple rapist classification is "automatic upon a defendant's second conviction for a rape offense"). The petitioner's prior rape conviction and two aggravated rape convictions in this case rendered him a multiple rapist as a matter of law. We conclude that the petitioner's classification as a multiple rapist is correct for the two aggravated rape convictions, and the petitioner is not entitled to relief on this issue.

III. FAILING TO GRANT WRIT
The petitioner claims that the trial court violated Tennessee Code Annotated section 29-21-108(b) in failing to grant him habeas corpus relief. The petitioner asserts he complied with all the required procedures for applying for a writ of habeas corpus. The petitioner asserts the trial court failed to uphold its duty by wrongfully refusing to issue a writ of habeas corpus. The state did not respond to this issue.
Section 29-21-108 presents
(a) It is the duty of the court or judge to act upon such applications instanter.
(b) A wrongful and willful refusal to grant the writ, when properly applied for, is a misdemeanor in office, besides subjecting the judge to damages at the suit of the party aggrieved.
T.C.A. § 29-21-108. We do not believe subsection (b) relates to judges who conclude in their judicial capacity that the facts or law do not warrant relief but who are determined on appeal to be in error. In any event, we note nothing contained in this allegation would entitle the petitioner to habeas corpus relief.

CONCLUSION
Based on the foregoing and the record as a whole, the judgment of the trial court is affirmed in part and reversed in part, and the case is remanded to the trial court.
