class SomeClass {
public SomeClass(){
}
@Inject
public SomeClass(SomeOtherClass object){
....
}
class SomeClass
{
public SomeClass(){
// required
by JAX-RS
}
@Inject
public SomeClass(SomeOtherClass object){
....
}
--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/xXGqFn42Azg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/02223b7d-1a12-4145-a5a9-319a77291aa9%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f9a33c41-15d1-4246-9962-c34b4dbebd90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public static class Builder {
private long id;
private String firstName;
private String lastName;
private String email;
/**
* Creates a builder used for cloning an existing user
* @param user User to clone
*/
public Builder(User user) {
this.id = user.id;
this.firstName = user.firstName;
this.lastName = user.lastName;
this.email = user.email;
}
/**
* Creattes a Builder used for creating a new user from scratch
*/
public Builder() {}
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/7f901455-ccdd-45da-a953-3460b1bd4e28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e20b2c7a-aa1f-47f8-8ba8-f8c69c887407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Karl,(always appreciated to use greeting around here).Not sure I am following you : the constructor with no arguments from JDK ArrayList is not empty.As discussed previously in this thread : if a public empty constructor is required, why shouldn't it deserve a comment ?Cheers,
Le jeu. 26 janv. 2017 à 11:05, <karl....@gmail.com> a écrit :
This rules is great for methods but is pretty useless for constructors if the project uses Java EE with CDI, JPA, JAX-RS etc. Also empty constructors are not so bad and the JDK has many of them. Have you never used new ArrayList<>()? Have you never used new ArrayList<>(collection)?
It is a poor rule that needs to be separated from empty methods because they are fundamentally different in the language
On Tuesday, November 17, 2015 at 12:08:59 PM UTC+1, pplo...@gmail.com wrote:Hi,since the update to the latest version of the Java plugin S1186 includes empty cosntructors.I want to suggest to disable this behavior. Unfortunately a lot of our classes need to have default constructors.There is also a discussion on Stackoverflow: http://stackoverflow.com/questions/32618188/sonar-methods-should-not-be-empty-at-the-constructorregardsPhilipp
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e20b2c7a-aa1f-47f8-8ba8-f8c69c887407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/8a47bd18-d7e0-483f-85cf-4d36b108fc6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.