fix inferred type error on jdk 6