Menu

#125 rename field does not detect downcast

open
9
2003-11-25
2003-09-28
programmeur
No

when using the rename field refactoring (pretty cool), I
noticed that the refactoring does not detect field
access for which we use a cast operator and leaves the
old field name.

For example:
Class A access class B through function code

class B field oldName

refactor oldName into m_iNewName

In a function code of A, using:
((ClassB)aBObject).oldName

the rename field refactoring did not renamed the field
access.

Hope I have not been too confusing, the issue is most
likely not new if it is still an issue.

Discussion

  • programmeur

    programmeur - 2003-09-28

    Logged In: YES
    user_id=854321

    Actually, I think one don't need the downcast for the issue to
    happen, simply access the field outside its definition class.

     
  • Mike Atkinson

    Mike Atkinson - 2003-09-28

    Logged In: YES
    user_id=476481

    Could you attach example file(s) showing the problem.

    Upped priority as bug causing erroneous code after
    refactoring is bad.

     
  • Mike Atkinson

    Mike Atkinson - 2003-09-28
    • priority: 5 --> 7
    • assigned_to: seguin --> mikeatkinson
     
  • programmeur

    programmeur - 2003-09-29

    Logged In: YES
    user_id=854321

    Ill provide different examples.

    P.

     
  • programmeur

    programmeur - 2003-09-29
     
  • programmeur

    programmeur - 2003-09-29
     
  • programmeur

    programmeur - 2003-09-29
     
  • programmeur

    programmeur - 2003-09-29

    Logged In: YES
    user_id=854321

    Here are three files that I think are o
    utlining the problems.

     
  • programmeur

    programmeur - 2003-09-30

    Logged In: YES
    user_id=854321

    Ok, I added 3 files, ClassA, ClassB and ClassC.
    Using rename field refactory with ClassB and ClassC should
    outline 2 different problems (not so sure about ClassA).

     
  • Mike Atkinson

    Mike Atkinson - 2003-11-25

    Logged In: YES
    user_id=476481

    I'm actively looking at this problem now, it also affects
    method renaming.

     
  • Mike Atkinson

    Mike Atkinson - 2003-11-25
    • priority: 7 --> 9
     

Log in to post a comment.