Skip to content

Suspicious assignment warning is triggered when using the Copy Constructor of a field within an object #5

Description

@oopsies49

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;
	}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions