Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override method but parameter is arg0

i use eclipse auto Override a method:

@Override
public void draw(Canvas arg0, MapView arg1, boolean arg2) {
    // TODO Auto-generated method stub
    super.draw(arg0, arg1, arg2);
}

you see ,the parameter is arg0,arg1,arg2,it is hard to read.i think if my eclipse is have mistake, because i think it should give me :

draw(Canvas canvas, MapView mapview, boolean flag)

so my question why my eclipse give me arg0 and so on,how to solve it?

like image 349
pengwang Avatar asked Aug 28 '12 06:08

pengwang


4 Answers

If you install "Documentation for Android SDK" via "Android SDK Manager" it will be fixed.

like image 109
auselen Avatar answered Sep 22 '22 01:09

auselen


This depends entirely on the fact whether or not Eclipse has the sources of the third party code available on the build path of that project. In your case it only has the binary class file, and can only provide you with the types, as argument names are not part of the binary anymore.

That said, please

  • install the sources of your Android target
  • have Maven download the sources of artifacts you use in Maven
  • attach sources to third party libraries that you use
  • install the SDK versions of Eclipse plugins that you use as target platform

to solve this issue in different environments.

like image 27
Bananeweizen Avatar answered Sep 18 '22 01:09

Bananeweizen


There is nothing wrong. That's Eclipse way of naming variables. But it is recommended to change them to proper names.

Side Note: To rename a variable in your code using Eclipse: Right click on the variable => Refactor => Rename

like image 40
iTurki Avatar answered Sep 18 '22 01:09

iTurki


It doesn't makes any difference. But Its always a good practice to write the code in such a way so that it should be self explanatory.

Imp is the "type" and no. of passing parameters in the method, They should be correct and Which i guess is.

like image 25
Mohit Avatar answered Sep 22 '22 01:09

Mohit