Repository: apache/kafka
File: clients/src/main/java/org/apache/kafka/clients/admin/MemberDescription.java (Java)

Code before:
        String memberId,
        Optional<String> groupInstanceId,
        Optional<String> rackId,
        String clientId,
        String host,
        MemberAssignment assignment,
        Optional<MemberAssignment> targetAssignment,
        Optional<Integer> memberEpoch,
        Optional<Boolean> upgraded
    ) {
        this.memberId = memberId == null ? "" : memberId;
        this.groupInstanceId = groupInstanceId;
        this.rackId = rackId;
        this.clientId = clientId == null ? "" : clientId;
        this.host = host == null ? "" : host;
        this.assignment = assignment == null ?
            new MemberAssignment(Collections.emptySet()) : assignment;
        this.targetAssignment = targetAssignment;
        this.memberEpoch = memberEpoch;
        this.upgraded = upgraded;
    }

    /**
     * @deprecated Since 4.2. Use {@link #MemberDescription(String, Optional, Optional, String, String, MemberAssignment, Optional, Optional, Optional)} instead.
     */
    @Deprecated
    public MemberDescription(
        String memberId,
        Optional<String> groupInstanceId,
        String clientId,
        String host,
        MemberAssignment assignment,
        Optional<MemberAssignment> targetAssignment,
        Optional<Integer> memberEpoch,
        Optional<Boolean> upgraded
    ) {
        this(
            memberId,
            groupInstanceId,
            Optional.empty(),
            clientId,
            host,
            assignment,
            targetAssignment,
            memberEpoch,
            upgraded
        );
    }

    /**
     * @deprecated Since 4.2. Use {@link #MemberDescription(String, Optional, Optional, String, String, MemberAssignment, Optional, Optional, Optional)} instead.

Review comment (suggestion):
Better would be `@Deprecated(since = "4.2", forRemoval = true)`. You may need to add more annotations to test cases which use the old constructor.

Code after:
        String memberId,
        Optional<String> groupInstanceId,
        Optional<String> rackId,
        String clientId,
        String host,
        MemberAssignment assignment,
        Optional<MemberAssignment> targetAssignment,
        Optional<Integer> memberEpoch,
        Optional<Boolean> upgraded
    ) {
        this.memberId = memberId == null ? "" : memberId;
        this.groupInstanceId = groupInstanceId;
        this.rackId = rackId;
        this.clientId = clientId == null ? "" : clientId;
        this.host = host == null ? "" : host;
        this.assignment = assignment == null ?
            new MemberAssignment(Collections.emptySet()) : assignment;
        this.targetAssignment = targetAssignment;
        this.memberEpoch = memberEpoch;
        this.upgraded = upgraded;
    }

    /**
     * @deprecated Since 4.2. Use {@link #MemberDescription(String, Optional, Optional, String, String, MemberAssignment, Optional, Optional, Optional)} instead.
     */
    @Deprecated(since = "4.2", forRemoval = true)
    public MemberDescription(
        String memberId,
        Optional<String> groupInstanceId,
        String clientId,
        String host,
        MemberAssignment assignment,
        Optional<MemberAssignment> targetAssignment,
        Optional<Integer> memberEpoch,
        Optional<Boolean> upgraded
    ) {
        this(
            memberId,
            groupInstanceId,
            Optional.empty(),
            clientId,
            host,
            assignment,
            targetAssignment,
            memberEpoch,
            upgraded
        );
    }

    /**
     * @deprecated Since 4.0. Use {@link #MemberDescription(String, Optional, Optional, String, String, MemberAssignment, Optional, Optional, Optional)} instead.