[GitHub] jmeter issue #257: Static Analysis Fixes

2017-01-27 Thread ham1
Github user ham1 commented on the issue:

https://github.com/apache/jmeter/pull/257
  
After reviewing my changes to `org.apache.jmeter.control` they were all 
suggested by my IDE (IntelliJ) so I am confident they are correct - however I 
understand if you don't want to apply some of them due to lack of tests etc.

Should I remove them from this PR or is whoever will apply this ok to 
filter out any risky changes?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] jmeter issue #257: Static Analysis Fixes

2017-01-25 Thread ham1
Github user ham1 commented on the issue:

https://github.com/apache/jmeter/pull/257
  
Thanks for looking at the PR and commenting.

I will take another look at the changes to `org.apache.jmeter.control` and 
either revert or justify them.
I'd gladly add more tests if we move to Spock ;)

The reason for replacing `StringBuilder` with `+` is for **readability**.

That article shows, that for the simple code i.e. not building a string 
inside loops etc. they are the same i.e. the JVM generates a `StringBuilder` 
for the simple `+` code.
I believe they have the same performance but for me reading:

`"nodeList[" + i + "] " + nodeList.item(i)`
is much easier than:
`new StringBuilder("nodeList[").append(i).append("] 
").append(nodeList.item(i)).toString()`

and

`"Row: " + row`
much easier than:
`new StringBuilder("Row: ").append(row).toString()`

My change in `InfluxdbBackendListenerClient` might be a tiny bit slower due 
to the initial capacity that the JVM might use the default of 16 causing some 
resizing of buffers.

Hope that makes sense.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] jmeter issue #257: Static Analysis Fixes

2017-01-25 Thread pmouawad
Github user pmouawad commented on the issue:

https://github.com/apache/jmeter/pull/257
  
Hello, 
Another question I have.
I see you replace StringBuilder by '+' concat.
Is there a reason for this ?
Reading:
- 
http://www.pellegrino.link/2015/08/22/string-concatenation-with-java-8.html

I don't understand that their performance is better.
Do you have another reference ?
Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] jmeter issue #257: Static Analysis Fixes

2017-01-25 Thread pmouawad
Github user pmouawad commented on the issue:

https://github.com/apache/jmeter/pull/257
  
@ham1 , Thanks a lot for your contribution.
Looks globally good for me.
I have just one remark, I wouldn't "optimize" the org.apache.jmeter.control 
package classes.
This part of JMeter is one of the most complex and less readable.
We need by the way to increase our Test coverage on these.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---