Not just one, not just two, but three generations of McCains are now honored on a U.S. Navy ship in the Pacific.

The secretary of the Navy added U.S. Sen. John McCain's name Thursday to a warship that had already been named for the Arizona lawmaker's father and grandfather, both former Navy admirals.

The re-dedication ceremony took place aboard the USS John S. McCain at an American base in Japan. Scaffolding covered the mast of the guided-missile destroyer, which is undergoing extensive repairs after a deadly collision, one of two last year that led to charges against senior ship officers and a highly critical review of Navy procedures and policies.

Richard Spencer, the Navy secretary, told reporters that recommended changes in operations have been 78 percent implemented. Some have been completed, he said, while others such as instilling a culture of continuous learning will take two years.

"I think we're well underway," Spencer said at Yokosuka Naval Base south of Tokyo.

Seventeen sailors died after the USS Fitzgerald and then the McCain collided with commercial vessels in the Pacific Ocean in June and August of 2017.

The three generations of McCains share the same name, John Sidney McCain, though they went or go by Sidney, Jack and John, from oldest to youngest. Their naval careers overlapped in World War II and Vietnam.

"It's a name in three parts, and a name that has three stories," Spencer said.

Sidney joined the Navy in the early 20th century and was an aircraft carrier task force commander in World War II. His son Jack was a submarine commander in World War II who rose to be head of the U.S. Pacific Command during the Vietnam War.

John was a naval aviator who was captured in Vietnam, where he was held for five years and tortured.

"Sen. McCain has proven that even the most difficult challenges can become sources of great strength," Micah Murphy, the commander of the USS McCain, told his crew at the ceremony, alluding to the challenges they face as they work with repair teams to get the ship back to sea.

The guided-missile destroyer, which had a gaping hole in its side after the collision, was launched in 1994.

"Sidney, Jack and John. Three distinguished officers. Three truly remarkable Americans," Spencer said.

McCain, who is battling brain cancer, said he looks back with gratitude on his formative years in the Navy.

"I hope the generations of sailors who will serve aboard the USS McCain will find the same fulfillment that my family does in serving a cause greater than oneself," the 81-year-old lawmaker said in a news release from his office.

Spencer said the Navy hopes to return the warship to service next spring.