Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

@InstanceState Bundle bundle makes StackOverflowError #1324

@YoungjaeKim

Description

@YoungjaeKim

When we code as below, it generates as follows,

    @InstanceState
    Bundle mBundle;

    @Override
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putBundle("mBundle", mBundle);
    }

But, accidently when we code as below,

    @InstanceState
    Bundle bundle;

AA generates as below, as you expected.

    @Override
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putBundle("bundle", bundle);
    }

This makes StackOverflowError due to infinite loop to do writeToParcel job, similar to the issue shown in the link: http://stackoverflow.com/a/15787218/361100

It would be good to throw an error when @InstanceState has variable named bundle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions