RodrigoDLopez opened a new issue #4596:
URL: https://github.com/apache/cloudstack/issues/4596
<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and master branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete
the comments.
-->
##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
* Enhancement Request
##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
All the cloudstack project
~~~
##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on master
branch.
-->
~~~
4.16
~~~
##### SUMMARY
<!-- Explain the problem/feature briefly -->
Currently cloudstack uses a lot of legacy code with variable names outside
the standard defined by JAVA. With this issue, I would like to express my
intention to correct this pattern module by module in a way that facilitates
the revisions and possible tests that may be required.
An example of normalization that we can perform, would be:
```
private final Properties _properties = new Properties ();
private final Map <String, Object> _cmdLineProperties = new HashMap
<String, Object> ();
private StorageComponent _storage;
private BackoffAlgorithm _backoff
```
For:
```
private Properties properties = new Properties ();
private Map <String, Object> cmdLineProperties = new HashMap <String,
Object> ();
private StorageComponent storage;
private BackoffAlgorithm backoff;
```
Several variables start with an underline, which differs from the standard
defined by JAVA (as we can see on JAVA oracle documentation:
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html), many
others use the reserved word FINAL without the need, which makes our code more
verbose and ends up increasing the time for reading/revising the new codes. The
use for final can also create problems for unit testing.
We could discuss which standard we will use, I vote for the CamelCase
standard since it seems to me to be the standard adopted by the vast majority
of our contributors.
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
~~~
private Properties properties = new Properties ();
private Map <String, Object> cmdLineProperties = new HashMap <String,
Object> ();
private StorageComponent storage;
private BackoffAlgorithm backoff;
~~~
##### ACTUAL RESULTS
<!-- What actually happened? -->
<!-- Paste verbatim command output between quotes below -->
~~~
private final Properties _properties = new Properties ();
private final Map <String, Object> _cmdLineProperties = new HashMap
<String, Object> ();
private StorageComponent _storage;
private BackoffAlgorithm _backoff
~~~
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]