?? I feel like you're jumping a handful of steps to reach that conclusion. This has nothing to do with whether the judge thinks it will stop him from committing a crime.
It's pretty simple, don't commit an obvious crime, especially in front of law enforcement.