-
1. Re: [forge-users] Checking if a class is final from JavaClassSource
gastaldi Feb 11, 2015 12:26 PM (in response to neoludo)Tried JavaClassSource.setFinal(false)?
Em 11/02/2015, às 15:24, forge-users@lists.jboss.org escreveu:
Hi,
maybe a dummy question, but I didn't find the way to check is a class is final, using JavaClassSource object ?
I need to check if, and remove final modifier if found.
Thanx for your help
Ludo
Posted by forums
Original post: https://developer.jboss.org/message/918504#918504
_______________________________________________
forge-users mailing list
_______________________________________________
forge-users mailing list
https://lists.jboss.org/mailman/listinfo/forge-users
-
2. Re: [forge-users] Checking if a class is final from JavaClassSource
lincolnthree Feb 11, 2015 5:33 PM (in response to gastaldi)George,
That method does not appear to exist. It looks like we are missing a
feature.
In the mean time, Ludo, you can call .toString() on the JavaClassSource
object and check for the final modifier before the first instance of the
type name:
if(source.toString().matches("^.*final(?<!" + source.getName() + ")"))
Something like that should work.
~Lincoln
On Wed, Feb 11, 2015 at 12:26 PM, George Gastaldi <ggastald@redhat.com>
wrote:
Tried JavaClassSource.setFinal(false)?
>
Em 11/02/2015, às 15:24, forge-users@lists.jboss.org escreveu:
Hi,
maybe a dummy question, but I didn't find the way to check is a class is
final, using JavaClassSource object ?
I need to check if, and remove final modifier if found.
Thanx for your help
Ludo
Posted by forums
Original post: https://developer.jboss.org/message/918504#918504
_______________________________________________
forge-users mailing list
_______________________________________________
forge-users mailing list
https://lists.jboss.org/mailman/listinfo/forge-users
--
Lincoln Baxter, III
"Simpler is better."
-
att1.html.zip 1.2 KB
-
-
3. Re: [forge-users] Checking if a class is final from JavaClassSource
gastaldi Feb 11, 2015 5:42 PM (in response to lincolnthree)Oh, my apologies, I could swear that method existed. I'll open a JIRA and get this done asap.
Thanks
Em 11/02/2015, às 20:33, Lincoln Baxter, III <lincolnbaxter@gmail.com> escreveu:
George,
That method does not appear to exist. It looks like we are missing a feature.
In the mean time, Ludo, you can call .toString() on the JavaClassSource object and check for the final modifier before the first instance of the type name:
if(source.toString().matches("^.*final(?<!" + source.getName() + ")"))
Something like that should work.
~Lincoln
>> On Wed, Feb 11, 2015 at 12:26 PM, George Gastaldi <ggastald@redhat.com> wrote:
>> Tried JavaClassSource.setFinal(false)?
>>
>>
>>
>> > Em 11/02/2015, às 15:24, forge-users@lists.jboss.org escreveu:
>> >
>> > Hi,
>> >
>> > maybe a dummy question, but I didn't find the way to check is a class is final, using JavaClassSource object ?
>> >
>> > I need to check if, and remove final modifier if found.
>> >
>> > Thanx for your help
>> > Ludo
>> >
>> > Posted by forums
>> > Original post: https://developer.jboss.org/message/918504#918504
>> > _______________________________________________
>> > forge-users mailing list
>> > forge-users@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/forge-users
>>
>> _______________________________________________
>> forge-users mailing list
>> forge-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-users
--
Lincoln Baxter, III
"Simpler is better."
_______________________________________________
forge-users mailing list
-
att1.html.zip 1.4 KB
-
-
4. Re: [forge-users] Checking if a class is final from JavaClassSource
gastaldi Feb 11, 2015 6:45 PM (in response to gastaldi)I created https://issues.jboss.org/browse/ROASTER-60 for this feature. Stay tuned for updates.
Em 11/02/2015, às 20:43, George Gastaldi <ggastald@redhat.com> escreveu:
Oh, my apologies, I could swear that method existed. I'll open a JIRA and get this done asap.
Thanks
>> Em 11/02/2015, às 20:33, Lincoln Baxter, III <lincolnbaxter@gmail.com> escreveu:
>>
>> George,
>>
>> That method does not appear to exist. It looks like we are missing a feature.
>>
>> In the mean time, Ludo, you can call .toString() on the JavaClassSource object and check for the final modifier before the first instance of the type name:
>>
>> if(source.toString().matches("^.*final(?<!" + source.getName() + ")"))
>>
>> Something like that should work.
>>
>> ~Lincoln
>>
>>> On Wed, Feb 11, 2015 at 12:26 PM, George Gastaldi <ggastald@redhat.com> wrote:
>>> Tried JavaClassSource.setFinal(false)?
>>>
>>>
>>>
>>> > Em 11/02/2015, às 15:24, forge-users@lists.jboss.org escreveu:
>>> >
>>> > Hi,
>>> >
>>> > maybe a dummy question, but I didn't find the way to check is a class is final, using JavaClassSource object ?
>>> >
>>> > I need to check if, and remove final modifier if found.
>>> >
>>> > Thanx for your help
>>> > Ludo
>>> >
>>> > Posted by forums
>>> > Original post: https://developer.jboss.org/message/918504#918504
>>> > _______________________________________________
>>> > forge-users mailing list
>>> > forge-users@lists.jboss.org
>>> > https://lists.jboss.org/mailman/listinfo/forge-users
>>>
>>> _______________________________________________
>>> forge-users mailing list
>>> forge-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-users
>>
>>
>>
>> --
>> Lincoln Baxter, III
>> "Simpler is better."
>> _______________________________________________
>> forge-users mailing list
>> forge-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-users
_______________________________________________
forge-users mailing list
-
att1.html.zip 1.4 KB
-
-
5. Re: Checking if a class is final from JavaClassSource
gastaldi Feb 11, 2015 9:48 PM (in response to neoludo)Hello,
I implemented this feature and it is now available in the master branch. Could you please try with the 2.12.1-SNAPSHOT version? If you are unable to find this version, please clone the sources from forge/roaster · GitHub and do a mvn clean install to build locally.
Thank you very much for your feedback!
George Gastaldi
-
6. Re: Checking if a class is final from JavaClassSource
neoludo Feb 12, 2015 1:55 AM (in response to gastaldi)Sounds great, I will test just right now, and give you a feedback.
Thanks for the quick fix
Ludovic Bertin
-
7. Re: Checking if a class is final from JavaClassSource
neoludo Feb 12, 2015 3:15 AM (in response to neoludo)It rocks! You're wonderful !
Thanx.
Ludovic Bertin