Judge affirms ruling