10BC0 A bug If I have the same method name · Issue #591 · androidannotations/androidannotations · GitHub
[go: up one dir, main page]

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.

A bug If I have the same method name  #591

@Tanlet

Description

@Tanlet

Sorry for my awful English.
Thanks to your work!AndroidAnnotation is a great project.I like this so muck.But I think I find a bug in my project.

Class 1:

@EActivity
public class Test1 extends Activity {
    @AfterViews
    public void init() {
        Log.v("","Word");
    }
}

Class 2:

@EActivity
public class Test2 extends Test1 {
    @AfterViews
    public void init() {
        Log.v("","Hello");
    }
}

The result is twice "Hello".
The reason is easy to find.
In the Test2_,We find this:

private void afterSetContentView_() {
      text = ((TextView) findViewById(id.text));
      init();
      init();
}

The right result is :

private void afterSetContentView_() {
     text = ((TextView) findViewById(id.text));
     init();
     supper.init();
}

Of course ,If you rename init() in Test2 to init2().It will work well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0