<commit_before>package org.simpleframework.xml.core;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.ElementMap;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.ValidationTestCase;

public class OriginalTest extends ValidationTestCase {
   
   private static final String SOURCE =
   "<exampleWithOriginals>\n"+
   "   <list>\n"+
   "      <string>a</string>\n"+
   "      <string>b</string>\n"+
   "      <string>c</string>\n"+
   "      <string>d</string>\n"+
   "   </list>\n"+
   "   <map>\n"+
   "      <entry>\n"+
   "         <string>a</string>\n"+
   "         <double>1.0</double>\n"+
   "      </entry>\n"+
   "      <entry>\n"+
   "         <string>b</string>\n"+
   "         <double>2.0</double>\n"+
   "      </entry>\n"+
   "      <entry>\n"+
   "         <string>c</string>\n"+
   "         <double>3.0</double>\n"+
   "      </entry>\n"+
   "   </map>\n"+
   "   <listEntry name='a' value='1'/>\n"+
   "   <listEntry name='b' value='2'/>\n"+
   "   <listEntry name='c' value='3'/>\n"+
   "   <listEntry name='d' value='4'/>\n"+
   "   <mapEntry>\n"+
   "      <double>1.0</double>\n"+
   "      <entry name='a' value='1'/>\n"+
   "   </mapEntry>\n"+
   "   <mapEntry>\n"+
   "      <double>2.0</double>\n"+
   "      <entry name='b' value='2'/>\n"+
   "   </mapEntry>\n"+
   "   <mapEntry>\n"+
   "      <double>3.0</double>\n"+
   "      <entry name='c' value='3'/>\n"+
   "   </mapEntry>\n"+
   "</exampleWithOriginals>\n";
   
   @Root
   @Namespace(prefix="entry", reference="http://domain/entry")
   private static class Entry {
      
      @Attribute
      private String name;
      
      @Attribute
      private String value;
      
      public Entry() {
         super();
      }
      
      public Entry(String name, String value) {
         this.name = name;
         this.value = value;
      }
      
      public boolean equals(Object entry) {
         if(entry instanceof Entry) {
            Entry other = (Entry) entry;
            return other.name.equals(name) && other.value.equals(value);
         }
         return false;
      }
      
      public int hashCode() {
         return name.hashCode() ^ value.hashCode();
      }
   }
   
   @Root
   private static class ExampleWithOriginals {
      
      @ElementList
      private Collection<String> list = new CopyOnWriteArrayList<String>();
   
      @ElementMap
      private Map<String, Double> map = new ConcurrentHashMap<String, Double>();<commit_msg>Add namespace list<commit_after>package org.simpleframework.xml.core;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.ElementMap;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.NamespaceList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.ValidationTestCase;

public class OriginalTest extends ValidationTestCase {
   
   private static final String SOURCE =
   "<exampleWithOriginals>\n"+
   "   <list>\n"+
   "      <string>a</string>\n"+
   "      <string>b</string>\n"+
   "      <string>c</string>\n"+
   "      <string>d</string>\n"+
   "   </list>\n"+
   "   <map>\n"+
   "      <entry>\n"+
   "         <string>a</string>\n"+
   "         <double>1.0</double>\n"+
   "      </entry>\n"+
   "      <entry>\n"+
   "         <string>b</string>\n"+
   "         <double>2.0</double>\n"+
   "      </entry>\n"+
   "      <entry>\n"+
   "         <string>c</string>\n"+
   "         <double>3.0</double>\n"+
   "      </entry>\n"+
   "   </map>\n"+
   "   <listEntry name='a' value='1'/>\n"+
   "   <listEntry name='b' value='2'/>\n"+
   "   <listEntry name='c' value='3'/>\n"+
   "   <listEntry name='d' value='4'/>\n"+
   "   <mapEntry>\n"+
   "      <double>1.0</double>\n"+
   "      <entry name='a' value='1'/>\n"+
   "   </mapEntry>\n"+
   "   <mapEntry>\n"+
   "      <double>2.0</double>\n"+
   "      <entry name='b' value='2'/>\n"+
   "   </mapEntry>\n"+
   "   <mapEntry>\n"+
   "      <double>3.0</double>\n"+
   "      <entry name='c' value='3'/>\n"+
   "   </mapEntry>\n"+
   "</exampleWithOriginals>\n";
   
   @Root
   @Namespace(prefix="entry", reference="http://domain/entry")
   private static class Entry {
      
      @Attribute
      private String name;
      
      @Attribute
      private String value;
      
      public Entry() {
         super();
      }
      
      public Entry(String name, String value) {
         this.name = name;
         this.value = value;
      }
      
      public boolean equals(Object entry) {
         if(entry instanceof Entry) {
            Entry other = (Entry) entry;
            return other.name.equals(name) && other.value.equals(value);
         }
         return false;
      }
      
      public int hashCode() {
         return name.hashCode() ^ value.hashCode();
      }
   }
   
   @Root
   @NamespaceList({@Namespace(prefix="root", reference="http://domain/entry")})
   private static class ExampleWithOriginals {
      
      @ElementList
      private Collection<String> list = new CopyOnWriteArrayList<String>();
   
      @ElementMap
      private Map<String, Double> map = new ConcurrentHashMap<String, Double>();
{'fraction_non_alphanumeric': 0.17384313024834733, 'fraction_numerical': 0.006789351438270502, 'mean_word_length': 2.2025171624713957, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 15}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4553687', 'n_tokens_mistral': 1825, 'n_tokens_neox': 1834, 'n_words': 309}