[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sonar-dev
Subject:    Re: [sonar-dev] Re: Access the type information of an ExpressionTree
From:       Nicolas Peru <nicolas.peru () sonarsource ! com>
Date:       2015-01-20 10:00:21
Message-ID: CAFHtbL1QzT97yteWF5VsYSh9YrwnYaTmMYaWjvisUo-nZRZmSQ () mail ! gmail ! com
[Download RAW message or body]

Hi Michael,

For the moment the recommend way is :  please be patient.

We definitely want to provide you this information from the API but this is
not yet available : we are taking our time as the semantic analysis is
complex work and still incomplete.

You can check my other replies on that topic:
http://sonarqube.15.x6.nabble.com/sonar-dev-Java-Plugin-API-Roadmap-amp-Imp=
lementation-Question-td5030618.html
http://sonarqube.15.x6.nabble.com/How-to-use-JavaFileScannerContext-getSema=
nticModel-td5029996.html

Cheers,

*Nicolas PERU | SonarSource*
*Senior Developer*
http://sonarsource.com
https://twitter.com/benzonico


On 15 January 2015 at 15:03, Michael M=C3=BCller <windstaerke1111@googlemai=
l.com>
wrote:

> (Sending again because I am not sure whether the previous mail had been
> posted)
>
> 2015-01-12 15:26 GMT+01:00 Michael M=C3=BCller <windstaerke1111@googlemai=
l.com>
> :
>
>> Hello,
>>
>> I am using SonarQube 4.5.1 and am wondering what the best way to retriev=
e
>> the type of a method invocation argument (represented by an ExpressionTr=
ee)
>> is.
>> I haven't found any way to access the type property using the provided
>> tree interfaces.
>>
>> I discovered a possible solution in the source code of the sonar-java
>> plugin.
>> They cast the tree to an AbstractTypedTree and that class offers the
>> method getType().
>> Though, AbstractTypedTree is an implementation class and I am not sure i=
f
>> a plugin is intended to interact with it...
>>
>> Furthermore, executing the plugin fails with the following exception
>> (note that the class is available at compilation time):
>> Caused by: java.lang.ClassNotFoundException:
>> org.sonar.java.model.AbstractTypedTree
>>         at
>> org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(Sel=
fFirstStrategy.java:50)
>>         at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass=
(ClassRealm.java:259)
>>         at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.ja=
va:235)
>>         at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.ja=
va:227)
>>         ... 65 more
>>
>> What is the recommended way to retrieve the type information?
>> Thank you.
>>
>> Regards,
>> windstaerke1111
>>
>
>

[Attachment #3 (text/html)]

<div dir="ltr">Hi Michael,  <div><br></div><div>For the moment the recommend way is : \
please be patient.  </div><div><br></div><div>We definitely want to provide you this \
information from the API but this is not yet available : we are taking our time as \
the semantic analysis is complex work and still incomplete.  \
</div><div><br></div><div>You can check my other replies on that topic:  \
</div><div><a href="http://sonarqube.15.x6.nabble.com/sonar-dev-Java-Plugin-API-Roadma \
p-amp-Implementation-Question-td5030618.html">http://sonarqube.15.x6.nabble.com/sonar- \
dev-Java-Plugin-API-Roadmap-amp-Implementation-Question-td5030618.html</a></div><div><a \
href="http://sonarqube.15.x6.nabble.com/How-to-use-JavaFileScannerContext-getSemanticM \
odel-td5029996.html">http://sonarqube.15.x6.nabble.com/How-to-use-JavaFileScannerConte \
xt-getSemanticModel-td5029996.html</a><br></div><div><br></div><div>Cheers,</div></div><div \
class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div \
dir="ltr"><div><strong \
style="font-size:12px;font-family:Arial,Helvetica,sans-serif">Nicolas PERU |  <font \
color="#C30C00">SonarSource</font></strong></div><div><font \
style="font-size:12px;font-family:Arial,Helvetica,sans-serif"><i \
style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px">Senior \
Developer</i><span style="color:rgb(102,102,102)"><font \
color="#c30c00"><b><br></b></font></span></font><a href="http://sonarsource.com/" \
style="color:rgb(195,12,0);font-size:12px;font-family:Arial,Helvetica,sans-serif" \
target="_blank">http://sonarsource.com</a></div><div><a \
href="https://twitter.com/benzonico" \
style="color:rgb(195,12,0);font-size:12px;font-family:Arial,Helvetica,sans-serif" \
target="_blank">https://twitter.com/benzonico</a><br></div><div><br></div></div></div></div>
 <br><div class="gmail_quote">On 15 January 2015 at 15:03, Michael Müller <span \
dir="ltr">&lt;<a href="mailto:windstaerke1111@googlemail.com" \
target="_blank">windstaerke1111@googlemail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">(Sending again because I am not sure whether \
the previous mail had been posted)<br></div><div class="HOEnZb"><div class="h5"><div \
class="gmail_extra"><br><div class="gmail_quote">2015-01-12 15:26 GMT+01:00 Michael \
Müller <span dir="ltr">&lt;<a href="mailto:windstaerke1111@googlemail.com" \
target="_blank">windstaerke1111@googlemail.com</a>&gt;</span>:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hello,<br><br>I am using SonarQube 4.5.1 and \
am wondering what the best way to retrieve the type of a method invocation argument \
(represented by an ExpressionTree) is.<br>I haven&#39;t found any way to access the \
type property using the provided tree interfaces.<br><br>I discovered a possible \
solution in the source code of the sonar-java plugin.<br>They cast the tree to an \
AbstractTypedTree and that class offers the method getType().<br>Though, \
AbstractTypedTree is an implementation class and I am not sure if a plugin is \
intended to interact with it...<br><br>Furthermore, executing the plugin fails with \
the following exception (note that the class is available at compilation \
time):<br>Caused by: java.lang.ClassNotFoundException: \
org.sonar.java.model.AbstractTypedTree<br>               at \
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)<br> \
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)<br> \
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)<br> \
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)<br> \
... 65 more<br><br>What is the recommended way to retrieve the type \
information?<br>Thank you.<br><br>Regards,<br>windstaerke1111</div> \
</blockquote></div><br></div> </div></div></blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic