Buggy code:
public Statement convert ( ExplicitConstructorCall statement ) { } public Expression convert ( Expression expression ) { } public StringLiteral convert ( ExtendedStringLiteral expression ) { } public BooleanLiteral convert ( FalseLiteral expression ) { } public Expression convert ( FieldReference reference ) { } public NumberLiteral convert ( FloatLiteral expression ) { } public Statement convert ( ForeachStatement statement ) { } public ForStatement convert ( org . eclipse . jdt . internal . compiler . ast . ForStatement statement ) { } public IfStatement convert ( org . eclipse . jdt . internal . compiler . ast . IfStatement statement ) { } public InstanceofExpression convert ( InstanceOfExpression expression ) { } public NumberLiteral convert ( IntLiteral expression ) { } public NumberLiteral convert ( IntLiteralMinValue expression ) { } public void convert ( Javadoc javadoc , BodyDeclaration bodyDeclaration ) { } public void convert ( Javadoc javadoc , PackageDeclaration packageDeclaration ) { } public LabeledStatement convert ( org . eclipse . jdt . internal . compiler . ast . LabeledStatement statement ) { } public NumberLiteral convert ( LongLiteral expression ) { } public NumberLiteral convert ( LongLiteralMinValue expression ) { } public Expression convert ( MessageSend expression ) { } public MarkerAnnotation convert ( org . eclipse . jdt . internal . compiler . ast . MarkerAnnotation annotation ) { } public MemberValuePair convert ( org . eclipse . jdt . internal . compiler . ast . MemberValuePair memberValuePair ) { } public Name convert ( NameReference reference ) { } public InfixExpression convert ( StringLiteralConcatenation expression ) { } public NormalAnnotation convert ( org . eclipse . jdt . internal . compiler . ast . NormalAnnotation annotation ) { } public NullLiteral convert ( org . eclipse . jdt . internal . compiler . ast . NullLiteral expression ) { } public Expression convert ( OR_OR_Expression expression ) { } public PostfixExpression convert ( org . eclipse . jdt . internal . compiler . ast . PostfixExpression expression ) { } public PrefixExpression convert ( org . eclipse . jdt . internal . compiler . ast . PrefixExpression expression ) { } public Expression convert ( QualifiedAllocationExpression allocation ) { } public Name convert ( QualifiedNameReference nameReference ) { } public Name convert ( QualifiedSuperReference reference ) { } public ThisExpression convert ( QualifiedThisReference reference ) { } public Expression convert ( Reference reference ) { } public ReturnStatement convert ( org . eclipse . jdt . internal . compiler . ast . ReturnStatement statement ) { } public SingleMemberAnnotation convert ( org . eclipse . jdt . internal . compiler . ast . SingleMemberAnnotation annotation ) { } public SimpleName convert ( SingleNameReference nameReference ) { } public Statement convert ( Statement statement ) { } public Expression convert ( org . eclipse . jdt . internal . compiler . ast . StringLiteral expression ) { } public SwitchStatement convert ( org . eclipse . jdt . internal . compiler . ast . SwitchStatement statement ) { } public SynchronizedStatement convert ( org . eclipse . jdt . internal . compiler . ast . SynchronizedStatement statement ) { } public Expression convert ( ThisReference reference ) { } public ThrowStatement convert ( org . eclipse . jdt . internal . compiler . ast . ThrowStatement statement ) { } public BooleanLiteral convert ( TrueLiteral expression ) { } public TryStatement convert ( org . eclipse . jdt . internal . compiler . ast . TryStatement statement ) { } public ASTNode convert ( TypeDeclaration typeDeclaration ) { } public TypeParameter convert ( org . eclipse . jdt . internal . compiler . ast . TypeParameter typeParameter ) { } public Name convert ( TypeReference typeReference ) { } public PrefixExpression convert ( UnaryExpression expression ) { } public WhileStatement convert ( org . eclipse . jdt . internal . compiler . ast . WhileStatement statement ) { } public ImportDeclaration convertImport ( ImportReference importReference ) { final ImportDeclaration importDeclaration = new ImportDeclaration ( this . ast ) ; <START_BUG> final boolean onDemand = importReference . onDemand ; <END_BUG> final char [ ] [ ] tokens = importReference . tokens ; int length = importReference . tokens . length ; final long [ ] positions = importReference . sourcePositions ; if ( length > 1 ) { importDeclaration . setName ( setQualifiedNameNameAndSourceRanges ( tokens , positions , importReference ) ) ; } else { final SimpleName name = new SimpleName ( this . ast ) ; name . internalSetIdentifier ( new String ( tokens [ 0 ] ) ) ; final int start = ( ( int ) ( ( positions [ 0 ] ) > > > 32 ) ) ; final int end = ( ( int ) ( ( positions [ 0 ] ) & - 1 ) ) ; name . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; name . index = 1 ; importDeclaration . setName ( name ) ; if ( this . resolveBindings ) { recordNodes ( name , importReference ) ; } } importDeclaration . setSourceRange ( importReference . declarationSourceStart , ( ( ( importReference . declarationEnd ) - ( importReference . declarationSourceStart ) ) + 1 ) ) ; importDeclaration . setOnDemand ( onDemand ) ; int modifiers = importReference . modifiers ; if ( modifiers != ( ClassFileConstants . AccDefault ) ) { switch ( this . ast . apiLevel ) { case AST . JLS2_INTERNAL : importDeclaration . setFlags ( ( ( importDeclaration . getFlags ( ) ) | ( ASTNode . MALFORMED ) ) ) ; break ; case AST . JLS3 : if ( modifiers == ( ClassFileConstants . AccStatic ) ) { importDeclaration . setStatic ( true ) ; } else { importDeclaration . setFlags ( ( ( importDeclaration . getFlags ( ) ) | ( ASTNode . MALFORMED ) ) ) ; } }

Fix:
final boolean onDemand = ( ( importReference . bits ) & ( ASTNode . OnDemand ) ) != 0 ;