5.  The first applicant was born in 1974 and lives in Vecumnieki. The second applicant was born in 1980 and lives in Riga. 6.  The facts of each individual case, as submitted by the parties, are summarised below. 7.  On 20 January 2005 a judge of the Valmiera District Court issued a detention order authorising the pre-trial detention of the first applicant for a duration of two months. The applicant was suspected of the sale of narcotics and of providing unauthorised objects to imprisoned prisoners. The decision stated that the first applicant’s whereabouts were unknown, that he had absconded from the pre-trial investigation and that there was a risk that he might abscond even after his whereabouts were established. The order was executed on 26 August 2005 when the police arrested the applicant. The applicant appealed. 8.  On 16 September 2005 the decision concerning the detention order was upheld by a panel of the Vidzeme Regional Court composed of three judges who were presided over by Judge G.K. The decision stated that the applicant had previously absconded and that, given the seriousness of the charges against him and the fact that he had no permanent place of residence, the court was not persuaded that he would not seek to abscond again. 9.  On 5 December 2005 a panel of the Vidzeme Regional Court, composed of two lay judges and presided over by Judge G.K., commenced the adjudication of the applicant’s criminal case. Relying on section 52(4)(1) of the Criminal Procedure Law, which prevented a judge from adjudicating a criminal case if he or she had previously been involved in the criminal proceedings, the defence challenged the participation of Judge G.K. The court, presided by the challenged judge, rejected the challenge, arguing that Judge G.K. had reviewed the applicant’s detention order prior to the enactment of the Criminal Procedure Law[1], so her previous participation in the criminal proceedings could not serve as grounds for her recusal. 10.  On 7 December 2005 the Vidzeme Regional Court convicted the applicant of the sale of narcotics and of providing unauthorised objects to imprisoned prisoners. In his appeal the applicant complained, inter alia, that section 52(4)(1) of the Criminal Procedure Law precluded Judge G.K. from adjudicating on his criminal case. 11.  On 7 September 2006 the appeal was dismissed by the Criminal Division of the Supreme Court. Concerning the complaint of partiality, the court stated the following:
“Judge G.K. reviewed the detention order at the time the Code of Criminal Procedure was in force. The adjudication of this [criminal] case was commenced after the Criminal Procedure Law had come into force, therefore the Court does not recognise a conflict of interests [of the judge] in that it cannot be concluded that G.K. had previously participated in any capacity in the criminal proceedings at issue”. 12.  On 24 October 2006, following an appeal on points of law lodged by the first applicant, the Senate of the Supreme Court dismissed the complaint concerning the allegedly unlawful composition of the first-instance court due to the participation of Judge G.K. The Senate upheld the lower courts’ findings that when Judge G.K. had participated in the review of the applicant’s detention order the Code of Criminal Procedure was in force, which authorised a judge to examine a criminal case even if he or she had previously taken decisions concerning preventive measures in the criminal case at issue. Observing that the criminal case was adjudicated on the merits after the new Criminal Procedure Law had come into force, the Senate concluded that Judge G.K. had not participated in the criminal proceedings at an earlier stage in any capacity. 13.  On 1 April 2005 the second applicant was detained on suspicion of robbery. On 4 April 2005 a judge of the Rēzekne Court authorised his pre‑trial detention. The second applicant appealed. 14.  On 18 April 2005 the second applicant’s appeal was dismissed by a panel of the Latgale Regional Court composed of three judges – J.D. (the presiding judge), D.S., and J.V. The court noted that in his appeal the second applicant had indicated that he had confessed to the offence and that he would not evade the investigation because he had to repay a bank loan. The applicant also indicated his intention to start a family. The court established, inter alia, that the applicant had four prior convictions, including one for robbery. It went on to state:
“Despite having served a prison sentence, [the second applicant] does not learn any lessons and is once again suspected of having committed an identical crime. He commits such acts regardless of the considerations included in his own appeal, [such as] a bank loan, an intention to start a family, a permanent job and a place of residence...
[The applicant’s] personality and tendency to commit crimes are to be seen as exceptional grounds for [applying pre-trial detention]”. 15.  On 4 December 2006 the Rēzekne Court convicted the applicant of robbery and of theft of personal identity documents and sentenced him to a prison term of eight years. The applicant appealed. 16.  On 2 February 2007 the applicant’s appeal was examined by a panel of the Latgale Regional Court composed of judges J.V. (the presiding judge), J.D. and D.S., the same judges who had previously examined his appeal against the decision of 4 April 2005. The applicant’s appeal was dismissed. 17.  The applicant submitted an appeal on points of law, in which he complained, among other things, about the composition of the appeal court. According to the applicant, the composition had been unlawful because of the three judges’ prior involvement in the same criminal proceedings. He stated that “the court could not be impartial”. 18.  On 19 April 2007 a single judge of the Senate of the Supreme Court informed the applicant that his appeal on points of law had not been accepted for adjudication on the merits in the Senate. With regard to the complaint about the composition of the appeal court, the judge referred to an earlier decision of the Senate (see Relevant domestic law and practice, paragraph 27 below) in which no violation of the applicable procedural law had been found in a situation identical to that of the applicant.