SACRAMENTO — When recently asked about their sexual orientation and gender identity, 40 percent of California’s jurists gave the same answer: None of your business.

In a survey released Thursday by the Judicial Council, 672 judges and justices refused to say whether they are gay, straight, bisexual or transgender. Of the remaining 1,005 who did respond, 969 said they are heterosexual, 19 are lesbians and 17 are gay. One respondent is transgender.

The optional, and controversial, questions about gender and sexual identity were asked for the first time in the state-mandated annual survey of bench officers, which also asks jurists to disclose their race, ethnicity and gender.

State Sen. Ellen Corbett, D-San Leandro, authored successful legislation in 2011 to require the judiciary to ask about gender identity and sexual orientation.

“It’s essential that a state as diverse as California has judges that reflect that diversity,” Corbett said in an email Thursday.

But some judges said the new questions go too far.

“I understand the desire to get the information in order to evaluate diversity and the comparison of the makeup of the bench with society as a whole,” said Yolo County Superior Court Judge Timothy Fall. “But … to see that 40 percent of the respondents did not provide the information tells me there’s a large number of judges who don’t feel this is anyone’s business except their own.”

In many of the state’s trial courts, more than half of the bench refused to answer the sexual identity and gender orientation questions. In two smaller courts, San Benito and Mariposa, none of the judges answered. And in the Fourth District Court of Appeal, 13 of 24 justices, or 54 percent, did not disclose.

The numbers are “meaningful in the sense that it does not show zero,” said Rebekah Orr, spokeswoman for Equality California, the gay rights group that sponsored the legislation requiring the new questions. “You can look at it the other way: nearly two-thirds [of judges] did respond … It’ll be interesting to see how that voluntary disclosure changes over time.”

The gender, race and ethnicity figures revealed by the survey remain almost unchanged from 2010. California’s benches are still dominated by white men, even as the state grows more ethnically diverse. Almost 69 percent of the state’s judges and justices are men. Seventy-two percent of all judges who completed the survey identified themselves as white.

In other findings:

• In courts with more than 10 judges, Contra Costa and Monterey have the highest percentage of women serving on the bench: 47 percent. San Francisco follows with 46 percent, Butte has 45.5 percent and Stanislaus has 45 percent. In four-judge Yuba County, three of the judges are women.

• No court had a majority of ethnic-minority jurists. Half of the judges in Imperial, San Benito and Calaveras trial courts described themselves as non-white. That was also true of justices on the Third District Court of Appeal.

• The percentages of almost all racial and ethnic groups, including whites, have increased over the past five years, a rise that’s due in part to more judges agreeing to provide demographic information. Only the percentage of multiracial judges decreased over that span, dropping from 4.4 percent to 3.5 percent.

According to statistics released separately by the governor’s office Thursday, the applicant pool largely mirrors the existing bench. Of the 768 attorneys who sought judgeships in 2011, 32 percent were women and 32 percent identified themselves as American Indian or Alaska Native; Asian; Black or African-American; Hispanic; Native Hawaiian or Other Pacific Islander; or “other.”

One-third of Gov. Jerry Brown’s first 15 judicial appointments are women and 53 percent are racial or ethnic minorities, according to the governor’s office.

Update: The link in the second paragraph from the word “survey” has been fixed to point to this year’s survey. Previously, it incorrectly linked to the 2011 report.