The inspection should recognize that using a copy constructor within a copy constructor is necessary when dealing with non-primitive fields.
class SomeObject {
private SomeOtherObject someObjectField;
public SomeObject(SomeObject other) {
this.someObjectField = new SomeOtherObject(other.someObjectField);
}
}
class SomeOtherObject {
private String field;
public SomeOtherObject(SomeOtherObject other) {
this.field = other.field;
}
}
The inspection should recognize that using a copy constructor within a copy constructor is necessary when dealing with non-primitive fields.