anonymous inner class

39 views
Skip to first unread message

Vipin Aravind

unread,
Sep 30, 2012, 12:01:21 PM9/30/12
to jar...@googlegroups.com
when  I  rename  a  class that  contains  a inner class, the  inner  class  is  not  renamed.

Jochen Theodorou

unread,
Oct 1, 2012, 3:22:14 AM10/1/12
to Vipin Aravind, jar...@googlegroups.com
Am 30.09.2012 18:01, schrieb Vipin Aravind:
> when I rename a class that contains a inner class, the inner
> class is not renamed.

how do you do the renaming?

bye blackdrag

--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

Vipin Aravind

unread,
Oct 1, 2012, 3:27:11 AM10/1/12
to Jochen Theodorou, jar...@googlegroups.com
I  resolved  this  by  not  renaming  the  classes but  only  the  namespace. If  I  rename  the  class,  inner  class names  don't  change.
rules  that  don't  work:-
rule com.example.** test.com.example.@1xyz

I  went  about  fixing  this  by  doing  this
rule com.example.** test.com.example.@1

Jochen Theodorou

unread,
Oct 1, 2012, 3:40:20 AM10/1/12
to Vipin Aravind, jar...@googlegroups.com
Am 01.10.2012 09:27, schrieb Vipin Aravind:
> I resolved this by not renaming the classes but only the
> namespace. If I rename the class, inner class names don't change.
> rules that don't work:-
> rule com.example.** test.com.example.@1xyz
>
> I went about fixing this by doing this
> rule com.example.** test.com.example.@1

you wanted to rename com.example.A to test.com.example.Axyz ?

Vipin Aravind

unread,
Oct 1, 2012, 3:45:40 AM10/1/12
to Jochen Theodorou, jar...@googlegroups.com
yes  that  was  the  intention,  but  then  if  A  contains  a  inner  class B like  below, it  does not  rename  class  B(  so  it  ends  up  still like  this test.com.example.A.Bxyz instead  of  test.com.example.Axyz.Bxyz:-

class A{

public  class B {

Jochen Theodorou

unread,
Oct 1, 2012, 3:57:02 AM10/1/12
to Vipin Aravind, jar...@googlegroups.com
Am 01.10.2012 09:45, schrieb Vipin Aravind:
> yes that was the intention, but then if A contains a inner
> class B like below, it does not rename class B( so it ends up
> still like this test.com.example.A.Bxyz instead of
> test.com.example.Axyz.Bxyz:-

The problem is that the matcher will simply match a text part. It has no
real understanding of what is a class. Instead A is here seen as
"package". Assuming we want to keep the current way, how would you make
a new rule, not conflicting with the old one, that expresses what you
want to do? Any idea?

Vipin Aravind

unread,
Oct 1, 2012, 4:40:56 AM10/1/12
to Jochen Theodorou, jar...@googlegroups.com
I  am  not  spending  time  on  this  as  for  my  purpose  I  just  need  to  rename  the  namespace  not  the  classname, so  I  ended  up  doing  this:-

rule com.example.** test.com.example.@1
Reply all
Reply to author
Forward
0 new messages