sonar + findbug + checkstyle +….

this code review tool has cost me much time, due to the poor documentation of sonar, and actually wrong documentaion.

1. the command should be “mvn sonar3:sonar” instead of “mvn sonar:sonar”. the latter would download sonar-maven-plugin-2.0-beta, which would always display the class missing/ class not accessible through classloader exception. the former command would instead download and install sonar-maven-plugin-2.4.1, which is the latest version, using which, the can be utilized locating the needed library jars.
2.there are some checkstyle, pmd null pointer exceptions, this is due to the configuration of each. something like single regexp setting, even though its default value is “^$”, however, specify this explicitly or not, makes a null pointer exception difference. which again proves, sth wrong with the sonar, or the plugin.

3. there are plugins to generate pdf report, sonar-pdfreport-plugin-1.2.jar

4. there are plugins to analyze the jsp, html files, sonar-web-plugin-1.0.2.jar. (however, Please note you can run sonar analysis for an artefact in only one language (SONAR-926). So you cannot run a web analysis and a java analysis on the same maven project. The fix is to make a separate maven pom for the web project with a different name. )

set up sonar yesterday, then start running against the project

there is one critical error, claiming
Security – Array is stored directly : The user-supplied array ‘lSelectedProdList’ is stored directly.

I just went through a research, then quickly refreshed what I have been done for passing SCJP.

shallow copy of the clone, is to clone the object, with primitive variables copies, reference variables, the values of the reference variable, which is the address of the being referred object copied.

Deep copy clone, is to have another copy of the object, the reference variable referred.

see
@http://www.coders2020.com/what-is-shallow-copy-and-deep-copy-in-java


Java provides a mechanism for creating copies of objects called cloning. There are two ways to make a copy of an object called shallow copy and deep copy.
Shallow copy is a bit-wise copy of an object. A new object is created that has an exact copy of the values in the original object. If any of the fields of the object are references to other objects, just the references are copied. Thus, if the object you are copying contains references to yet other objects, a shallow copy refers to the same subobjects.
Deep copy is a complete duplicate copy of an object. If an object has references to other objects, complete new copies of those objects are also made. A deep copy generates a copy not only of the primitive values of the original object, but copies of all subobjects as well, all the way to the bottom. If you need a true, complete copy of the original object, then you will need to implement a full deep copy for the object.
Java supports shallow and deep copy with the Cloneable interface to create copies of objects. To make a clone of a Java object, you declare that an object implements Cloneable, and then provide an override of the clone method of the standard Java Object base class. Implementing Cloneable tells the java compiler that your object is Cloneable. The cloning is actually done by the clone method.”

set up filezilla ftp sever from home sever

FTP protocol is first draft in 1971, and current specs are from 1985. It’s an ancient technology where NAT, firewalls not there.

As for now, to set up a FTP server from home LAN, some configurations need to be catered as a result.

There are actually two connections for FTP, control connections and data connections. Two modes for data connections, passive mode (for server), and active mode (for server).

Passive mode is recommended,  which is the case, client come to pull data. While port or active mode is server to push data to client.

Settings are actually not complex, but deserve attention and carefulness. To add on the frustration for this is the lack of proper explanation from the internet.

Too much messed info is worse than no info.

For the server set up,

  1. general settings, to specify the listen port, which is default 21. But some ISPs might block this port, including mine. So specify a different port, and NAT it from your external IP to your filezilla server internal ip. lets say port 29000. eg.
  2. (Somewhere most problems seen from internet are due to this) under passive mode settings, specify the external ip address, which is http://www.yourWebServer.com, http://www.best2jj.com for my case.
  3. The tricky part, specify the port range, let’s say 30000-40000, and NAT it also. The configuration of this is the data connections of the two FTP connections, other than the control connections, which lying on port 29000.

    A lot of problems seen from internet are due to this, cause other than the listening port, FTP uses another range of ports, for data connections.

refer, Network Configuration
Done this, it works fine.