From cb1bb5d131addd27e2927ec90cc572a8c4d40f80 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 09 Jan 2014 09:52:23 +0000
Subject: [PATCH] Front-port of r10098.
---
opendj3-server-dev/src/server/org/opends/server/replication/common/DSInfo.java | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/common/DSInfo.java b/opendj3-server-dev/src/server/org/opends/server/replication/common/DSInfo.java
index fcc036d..fb42a43 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/common/DSInfo.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/common/DSInfo.java
@@ -22,12 +22,11 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions copyright 2011-2013 ForgeRock AS
+ * Portions copyright 2011-2014 ForgeRock AS
*/
package org.opends.server.replication.common;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* This class holds information about a DS connected to the topology. This
@@ -35,8 +34,7 @@
* messages, to keep every member (RS or DS) of the topology aware of the DS
* topology.
* <p>
- * This class is almost immutable, because it does not copy the List and Set
- * passed into the ctor.
+ * @Immutable
*/
public final class DSInfo
{
@@ -68,7 +66,6 @@
private final Set<String> eclIncludesForDeletes;
-
/**
* Creates a new instance of DSInfo with every given info.
*
@@ -101,8 +98,8 @@
public DSInfo(int dsId, String dsUrl, int rsId, long generationId,
ServerStatus status, boolean assuredFlag,
AssuredMode assuredMode, byte safeDataLevel, byte groupId,
- List<String> refUrls, Set<String> eclIncludes,
- Set<String> eclIncludesForDeletes, short protocolVersion)
+ Collection<String> refUrls, Collection<String> eclIncludes,
+ Collection<String> eclIncludesForDeletes, short protocolVersion)
{
this.dsId = dsId;
this.dsUrl = dsUrl;
@@ -113,9 +110,11 @@
this.assuredMode = assuredMode;
this.safeDataLevel = safeDataLevel;
this.groupId = groupId;
- this.refUrls = refUrls;
- this.eclIncludes = eclIncludes;
- this.eclIncludesForDeletes = eclIncludesForDeletes;
+ this.refUrls = Collections.unmodifiableList(new ArrayList<String>(refUrls));
+ this.eclIncludes =
+ Collections.unmodifiableSet(new HashSet<String>(eclIncludes));
+ this.eclIncludesForDeletes =
+ Collections.unmodifiableSet(new HashSet<String>(eclIncludesForDeletes));
this.protocolVersion = protocolVersion;
}
--
Gitblit v1.10.0