You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/01/25 07:31:32 UTC

svn commit: r1780141 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Author: pmouawad
Date: Wed Jan 25 07:31:31 2017
New Revision: 1780141

URL: http://svn.apache.org/viewvc?rev=1780141&view=rev
Log:
Ignore sonar false positive

Modified:
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=1780141&r1=1780140&r2=1780141&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java (original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java Wed Jan 25 07:31:31 2017
@@ -266,7 +266,7 @@ public class JavaConfigGui extends Abstr
             JavaSamplerClient client = (JavaSamplerClient) Class.forName(className, true,
                     Thread.currentThread().getContextClassLoader()).newInstance();
             return client != null;
-        } catch (Exception ex) {
+        } catch (Exception ex) { // NOSONAR We already log this
             return false;
         }
     }



Re: svn commit: r1780141 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Posted by Philippe Mouawad <ph...@gmail.com>.
On Wed, Jan 25, 2017 at 4:05 PM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
>
> Am 25. Januar 2017 13:31:12 MEZ schrieb Philippe Mouawad <
> philippe.mouawad@gmail.com>:
> >On Wed, Jan 25, 2017 at 10:01 AM, Felix Schumacher <
> >felix.schumacher@internetallee.de> wrote:
> >
> >>
> >>
> >> Am 25. Januar 2017 08:31:32 MEZ schrieb pmouawad@apache.org:
> >> >Author: pmouawad
> >> >Date: Wed Jan 25 07:31:31 2017
> >> >New Revision: 1780141
> >> >
> >> >URL: http://svn.apache.org/viewvc?rev=1780141&view=rev
> >> >Log:
> >> >Ignore sonar false positive
> >> >
> >> >Modified:
> >> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> >> protocol/java/config/gui/JavaConfigGui.java
> >> >
> >> >Modified:
> >> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> >> protocol/java/config/gui/JavaConfigGui.java
> >> >URL:
> >> >http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/
> >>
> >java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=
> >> 1780141&r1=1780140&r2=1780141&view=diff
> >> >===========================================================
> >> ===================
> >> >---
> >> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> >> protocol/java/config/gui/JavaConfigGui.java
> >> >(original)
> >> >+++
> >> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> >> protocol/java/config/gui/JavaConfigGui.java
> >> >Wed Jan 25 07:31:31 2017
> >> >@@ -266,7 +266,7 @@ public class JavaConfigGui extends Abstr
> >> >JavaSamplerClient client = (JavaSamplerClient)
> >Class.forName(className,
> >> >true,
> >> >
> >Thread.currentThread().getContextClassLoader()).newInstance();
> >> >             return client != null;
> >>
> >> Can client be null, or would an exception be thrown?
> >>
> >No but it is just to cast to JavaSamplerClient (needed) and use the
> >local
> >variable to avoid another warning.
> >Do you have another idea ?
>
> Return true? My comment was about the comparison to null. The cast is
> obvious and necessary.
>
But Sonar will say unused var no ?
I commited, feel free to fix as you like, I won't complain :-)

>
> >
> >>
> >> >-        } catch (Exception ex) {
> >> >+        } catch (Exception ex) { // NOSONAR We already log this
> >>
> >> I think sonar complains, as we are loosing the information from the
> >> exception here.
> >>
> >
> >
> >>
> >> Should we log it here and remove the log from the calling function?
> >>
> >Yes, will fix it this way
>
> Thanks,
> Felix
>
> >
> >>
> >> Felix
> >>
> >> >             return false;
> >> >         }
> >> >     }
> >>
>



-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1780141 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 25. Januar 2017 13:31:12 MEZ schrieb Philippe Mouawad <ph...@gmail.com>:
>On Wed, Jan 25, 2017 at 10:01 AM, Felix Schumacher <
>felix.schumacher@internetallee.de> wrote:
>
>>
>>
>> Am 25. Januar 2017 08:31:32 MEZ schrieb pmouawad@apache.org:
>> >Author: pmouawad
>> >Date: Wed Jan 25 07:31:31 2017
>> >New Revision: 1780141
>> >
>> >URL: http://svn.apache.org/viewvc?rev=1780141&view=rev
>> >Log:
>> >Ignore sonar false positive
>> >
>> >Modified:
>> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
>> protocol/java/config/gui/JavaConfigGui.java
>> >
>> >Modified:
>> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
>> protocol/java/config/gui/JavaConfigGui.java
>> >URL:
>> >http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/
>>
>java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=
>> 1780141&r1=1780140&r2=1780141&view=diff
>> >===========================================================
>> ===================
>> >---
>> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
>> protocol/java/config/gui/JavaConfigGui.java
>> >(original)
>> >+++
>> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
>> protocol/java/config/gui/JavaConfigGui.java
>> >Wed Jan 25 07:31:31 2017
>> >@@ -266,7 +266,7 @@ public class JavaConfigGui extends Abstr
>> >JavaSamplerClient client = (JavaSamplerClient)
>Class.forName(className,
>> >true,
>> >        
>Thread.currentThread().getContextClassLoader()).newInstance();
>> >             return client != null;
>>
>> Can client be null, or would an exception be thrown?
>>
>No but it is just to cast to JavaSamplerClient (needed) and use the
>local
>variable to avoid another warning.
>Do you have another idea ?

Return true? My comment was about the comparison to null. The cast is obvious and necessary.

>
>>
>> >-        } catch (Exception ex) {
>> >+        } catch (Exception ex) { // NOSONAR We already log this
>>
>> I think sonar complains, as we are loosing the information from the
>> exception here.
>>
>
>
>>
>> Should we log it here and remove the log from the calling function?
>>
>Yes, will fix it this way

Thanks,
Felix

>
>>
>> Felix
>>
>> >             return false;
>> >         }
>> >     }
>>

Re: svn commit: r1780141 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Posted by Philippe Mouawad <ph...@gmail.com>.
On Wed, Jan 25, 2017 at 10:01 AM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
>
> Am 25. Januar 2017 08:31:32 MEZ schrieb pmouawad@apache.org:
> >Author: pmouawad
> >Date: Wed Jan 25 07:31:31 2017
> >New Revision: 1780141
> >
> >URL: http://svn.apache.org/viewvc?rev=1780141&view=rev
> >Log:
> >Ignore sonar false positive
> >
> >Modified:
> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> protocol/java/config/gui/JavaConfigGui.java
> >
> >Modified:
> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> protocol/java/config/gui/JavaConfigGui.java
> >URL:
> >http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/
> java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=
> 1780141&r1=1780140&r2=1780141&view=diff
> >===========================================================
> ===================
> >---
> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> protocol/java/config/gui/JavaConfigGui.java
> >(original)
> >+++
> >jmeter/trunk/src/protocol/java/org/apache/jmeter/
> protocol/java/config/gui/JavaConfigGui.java
> >Wed Jan 25 07:31:31 2017
> >@@ -266,7 +266,7 @@ public class JavaConfigGui extends Abstr
> >JavaSamplerClient client = (JavaSamplerClient) Class.forName(className,
> >true,
> >         Thread.currentThread().getContextClassLoader()).newInstance();
> >             return client != null;
>
> Can client be null, or would an exception be thrown?
>
No but it is just to cast to JavaSamplerClient (needed) and use the local
variable to avoid another warning.
Do you have another idea ?

>
> >-        } catch (Exception ex) {
> >+        } catch (Exception ex) { // NOSONAR We already log this
>
> I think sonar complains, as we are loosing the information from the
> exception here.
>


>
> Should we log it here and remove the log from the calling function?
>
Yes, will fix it this way

>
> Felix
>
> >             return false;
> >         }
> >     }
>



-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1780141 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 25. Januar 2017 08:31:32 MEZ schrieb pmouawad@apache.org:
>Author: pmouawad
>Date: Wed Jan 25 07:31:31 2017
>New Revision: 1780141
>
>URL: http://svn.apache.org/viewvc?rev=1780141&view=rev
>Log:
>Ignore sonar false positive
>
>Modified:
>jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
>
>Modified:
>jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
>URL:
>http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=1780141&r1=1780140&r2=1780141&view=diff
>==============================================================================
>---
>jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
>(original)
>+++
>jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
>Wed Jan 25 07:31:31 2017
>@@ -266,7 +266,7 @@ public class JavaConfigGui extends Abstr
>JavaSamplerClient client = (JavaSamplerClient) Class.forName(className,
>true,
>         Thread.currentThread().getContextClassLoader()).newInstance();
>             return client != null;

Can client be null, or would an exception be thrown?

>-        } catch (Exception ex) {
>+        } catch (Exception ex) { // NOSONAR We already log this

I think sonar complains, as we are loosing the information from the exception here.

Should we log it here and remove the log from the calling function?

Felix
 
>             return false;
>         }
>     }