Forty Bragg - President Donald Trump's criticism of Army Sergeant Bowe Bergdahl has become a factor in the soldier's sentencing as a military judge weighs the president's impact on public perception of military justice.The judge deciding Bergdahl's punishment for walking off his post in Afghanistan in 2009 heard defence arguments on Monday that Trump recently reaffirmed his scathing criticism and is preventing a fair sentencing hearing. Bergdahl faces a maximum sentence of life in prison after pleading guilty last week to desertion and misbehaviour before the enemy.The judge, Army Colonel Jeffery R Nance, allowed the attorneys to question him about whether he was swayed by Trump's comments, and responded that he would be fair."I don't have any doubt whatsoever that I can be fair and impartial in the sentencing in this matter," Nance said.But he had stern words for prosecutors about what effect Trump's comments would have on public perception of the case. He indicated he would issue a ruling later on the defense request to dismiss the case because of Trump.'Traitor'While campaigning, Trump repeatedly called Bergdahl a "traitor" who deserved harsh punishment such as being shot. Nance previously ruled those comments were "disturbing", but didn't amount to unlawful command influence and noted the statements were made before Trump became commander in chief.But last week Trump addressed his past comments when asked about them at a news conference. He replied that he couldn't say anything more about the case, "but I think people have heard my comments in the past". That, the defence said, shows he harbours the same views now that he commands the military.Prosecutors argued Trump's comments didn't reaffirm his campaign-trail criticism and were narrowly focused on answering a reporter.But Nance said he was having a "hard time" with prosecutors' interpretation, noting public confidence in military courts was something he had to consider.Nance said his interpretation was that Trump was essentially saying: "I shouldn't comment on that, but I think everyone knows what I think on Bowe Bergdahl."Bergdahl was captured soon after walking off his remote post in 2009. He has said he was caged, kept in darkness and beaten, and tried to escape more than a dozen times before President Barack Obama brought Bergdahl home in 2014 in a swap for five Taliban prisoners at Guantanamo Bay.