On Wed, Jan 25, 2017 at 4:05 PM, Felix Schumacher < [email protected]> wrote:
> > > Am 25. Januar 2017 13:31:12 MEZ schrieb Philippe Mouawad < > [email protected]>: > >On Wed, Jan 25, 2017 at 10:01 AM, Felix Schumacher < > >[email protected]> wrote: > > > >> > >> > >> Am 25. Januar 2017 08:31:32 MEZ schrieb [email protected]: > >> >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.
