Both the Florida Department of Juvenile Justice and 27 counties challenging the agency are claiming victory over a judge’s ruling in a long-running dispute about the costs of detaining juvenile offenders.

Either way, it could affect pending legislation, as lawmakers try again this year to resolve a quarrel dating back to 2004.