import java.util.Set;\r
import java.util.SortedMap;\r
import java.util.TreeMap;\r
+import java.util.UUID;\r
import java.util.regex.Matcher;\r
import java.util.regex.Pattern;\r
\r
if(mediaList != null){\r
for(Media media : mediaList){\r
\r
+ // media objects will modifies by this method, so\r
+ // we clone the medias in order to prevent them\r
+ // from being stores accidentally\r
+ // cloning will remove the id\r
+ try {\r
+ media = (Media) media.clone();\r
+ } catch (CloneNotSupportedException e) {\r
+ // should never happen\r
+ logger.error(e);\r
+ }\r
+\r
Set<MediaRepresentation> candidateRepresentations = new HashSet<MediaRepresentation>();\r
candidateRepresentations.addAll(media.getRepresentations());\r
\r