A federal judge rejected a suit from Bernie Sanders supporters requesting more time for voter registration in the crucial California primary, saying Wednesday that there was no basis for the suit.

"The citizens of California are smart enough to know what their rights are," Judge William Alsup said in a hearing.

The suit, filed May 20 by a group of Sanders backers and California's American Independent Party, alleged that the state's rules for independent voters, or "no party preference voters," are insufficiently clear.

Get Breaking News Delivered to Your Inbox

Voters who have not listed a party preference on their registration can cast their ballots in the Democratic primary, but must specifically request a Democratic ballot in order to vote in the presidential race. Those ballots had to be requested by Tuesday. (Republicans opted not to open their primary up to no party preference voters.)

For Sanders, who is fighting hard to win what would amount to a symbolic victory against Democratic front-runner Hillary Clinton, independents have been a crucial part of his winning coalition thus far. The Vermont senator has typically done best in states with open primaries, and tends to win by large margins among independent voters.

Still, Alsup, the federal judge, said voters are savvy enough to read and follow the rules. "If their ballot doesn't say Sanders, they can ask," he said.

Alsup also questioned why Sanders and his allies filed the suit so close to primary day, which is next Tuesday: "The plaintiffs waited way too long," he said.

Polling shows a close race between Sanders and Clinton, who canceled a day of events in New Jersey in order to spend more time campaigning in California.