A Pennsylvania judge ruled that Mr. Cosby had not been entitled to confront his accuser in a preliminary court hearing this spring.