TMZ has learned there's an eerie similarity between
Jennifer Aniston's alleged stalker and
Shawn Johnson's convicted stalker -- both guys had run-ins with police during cross-country treks to California ... and both were sent on their merry way.

As we first reported, Jen's alleged stalker
Jason Peyton drove from Pennsylvania to California last month to
allegedly hunt her down.
According to the Nebraska State Patrol, Peyton's car broke down on June 26, and a state trooper pulled over to assist him. The NSP says the trooper ran Peyton's plates and found there was a missing person's report out for him -- but the trooper let the 24-year-old go because he was of legal age and hadn't broken any laws.
What the trooper didn't know was that Peyton's parents filed the report because they feared he was going after Aniston.
Last year Shawn Johnson's stalker
Robert O'Ryan was
pulled over by Alabama cops while driving to California to find Shawn. O'Ryan -- who rambled during the stop about marrying Shawn -- was only ticketed for minor offenses and let go ... because cops had no legal reason to arrest him.
O'Ryan
was found guilty last month of felony stalking and deemed mentally insane -- while Peyton is currently under a 5150 psychiatric hold.
Shawn Johnson's obsessed fan is now officially a felony stalker -- and the just has just found him mentally insane.
Robert O'Ryan -- who went looking for Shawn last year with two guns in his car and then broke into the set of "
Dancing with the Stars" -- was also found guilty of carrying a loaded firearm in his car, as well as felony burglary.
The judge then ruled O'Ryan is legally insane and will be sent to a state mental hospital for evaluation. He could spend the rest of his life in a mental institution.
Shawn Johnson spent 23 minutes this morning testifying against her alleged stalker -- losing her composure when prosecutors showed her the knife found in the car of
Robert O'Ryan.

Johnson said she was nervous about appearing today and repeatedly testified she was afraid of O'Ryan. She said she considered quitting "
Dancing With the Stars" -- which she was participating in when O'Ryan was arrested -- but stayed on the show and went on to win.
O'Ryan pled not guilty
by reason of insanity on Monday to charges of felony stalking, felony commercial burglary and two misdemeanor counts of carrying a loaded firearm in his car.
He faces a max of six years in jail.
Shawn Johnson's alleged stalker
Robert O'Ryan is insane ... this according to the guy himself.

O'Ryan -- who's facing charges of felony stalking, felony commercial burglary and two misdemeanor counts of carrying a loaded firearm in his car -- plead not guilty by reason of insanity in L.A. County Superior Court.
As we previously reported, O'Ryan was arrested last year when he attempted to enter the set of "Dancing with the Stars" in an alleged effort to have an encounter with the Olympian.
During the hearing, the judge told O'Ryan -- who faces 6 years behind bars if convicted on all counts -- that if he was found to be insane, he could spend at least that amount of time in a state mental hospital.
O'Ryan's trial is scheduled to begin tomorrow -- and, as we first reported, Shawn Johnson is
set to testify against him.
Olympic gold medalist
Shawn Johnson will be forced to sit in the same room as her alleged stalker next week -- when she will personally testify against the guy in L.A. County Superior Court.

TMZ has learned Johnson will take the stand at the trial of
Robert O'Ryan -- who's facing several charges including felony stalking, felony commercial burglary and two misdemeanor counts of carrying a loaded firearm in his car -- all over a very close encounter with Johnson last year.
As we first reported, O'Ryan was arrested back in March 2009 after he allegedly tried to break onto the set of "
Dancing with the Stars" in an effort to confront Shawn -- while packing two loaded guns and duct tape in the trunk of his car.
The trial is scheduled to begin Monday morning.
Shawn Johnson's alleged stalker will stand trial for four of the five charges that were filed against him -- felony stalking, felony commercial burglary and two misdemeanor counts of carrying a loaded firearm in his car.

Robert O'Ryan was in court today in downtown Los Angeles. A judge decided to toss out the attempted kidnapping charge against O'Ryan even though he had a veritable kidnapper's field kit in his car -- including zip ties, duct tape, a shotgun, a .45 handgun, bulletproof vest, Buck Knife, sharpening stone, wooden club ... and a bag of apples.
The charge was tossed out because O'Ryan left all those items in his car when he allegedly went after Shawn -- and there was so much junk in O'Ryan's car, the court decided it would have been impossible to fit a kidnapping victim inside. Seriously. And Shawn is only 4'9".
O'Ryan's bail was set at $220,000.
New season, new contestants, same old outfit.

Swimmer
Natalie Coughlin was given the same frilly blue dress for her web promo that gymnast
Shawn Johnson wore on the show last year -- giving the lovely ladies something else in common other than the 2008 Olympics.
The dress could turn out to be good or bad luck: Johnson won "Dancing" last year ... but she also gained an alleged stalker.
Believe it or not, somewhere amongst all these little NYC kids is 17-year-old Olympian and "
Dancing with the Stars" champ
Shawn Johnson.

How old were those Chinese gymnasts again?!
Shawn Johnson won "
Dancing with the Stars" last night -- but in more important news, she just banked $365,000 doing it. Repeat: THREE HUNDRED AND SIXTY FIVE THOUSAND DOLLARS.

We got a hold of Shawn's "Dancing" contract a while back, which stated she would bank $125,000 up front, then incremental paychecks that topped off at $50k a week for the last 2 episodes.
That's a lotta cheese...
A preliminary hearing has been set for the trial of
Robert O'Ryan -- the man accused of stalking
Shawn Johnson.

O'Ryan and his impressive gathering of chin hair appeared in L.A. County Criminal Court today -- where a judge set the date for June 11.
O'Ryan faces three charges for the March incident -- one felony count of stalking and two misdemeanor counts of carrying a loaded firearm in a vehicle.
This dude in a Des Moines piano bar had
Shawn Johnson as red as the #3 billiard ball on his shirt after he sang a hilarious song
in honor of her and "Dancing with the Stars" partner Mark Ballas.

We'll just try and ignore the part where he sings about the 17-year-old's chest.