implementation improved to get compatibility with ECJ