Problem comparing two ArrayLists, elements must match, order not important.

Hello,
I am new to Java and my assignment is:
Write a method for the Purse class - public boolean sameCoins(Purse other), that checks whether the other purse has the same coins, perhaps in a different order.
For example, the purses:
*Purse[Quarter,Dime,Nickel,Dime]*
and
*Purse [Nickel,Dime,Dime,Quarter]*
should be considered equal.
You will probably need one or more helper methods.
I was able to make a method to check if the purses match(sameContents), but I have not been able to check if they match just based on elements(sameCoins). We are not using Collections.
Below is my Purse Class:
import java.util.ArrayList;
public class Purse {
    private ArrayList<String> coins;
    public Purse() {
        coins = new ArrayList<String>();
    public void addCoin(String coinName) {
        coins.add(coinName);
    public String toString() {
        String text = "Purse[ ";
        for (String a : coins)
            text += a;
        text += "]";
        return text;
    public boolean sameContents(Purse other) {
        boolean content = false;
        if (other.coins.equals(coins))
            content = true;
        return content;
    public boolean sameCoins(Purse other){
        boolean samecoins = true;
        for(String a: coins)
            for(String b: other.coins)
                if (a.contains(b))
                    samecoins = true;
                else
                    samecoins=false;
        return samecoins;
}Any help would be appreciated.

tipalm wrote:
Well then my prof cant hold it against me can he!He sure can, if he wants to. I'll bet you 30 duke stars that if you hand in the program as-is and try to argue for using the Collections framework, he's going to say "I meant you couldn't use any of the static methods in the Collections framework, the whole point of the assignment was to work through the logic of iterating through the Lists" But hey, it's not my assignment, so good luck!
Edit- I'm not saying that using the Collections framework (and its myriad static methods) is bad in any way. It's actually what you should use, assuming there are no academic "but don't use this shortcut" rules being applied. I just doubt that's your case here. I'd recommend looking into how the Collections framework works, and then implement your own algorithm based on that.
Edited by: kevinaworkman on Oct 29, 2009 10:13 AM

Similar Messages

  • Compare 2 ArrayList elements

    Hi,
    I want to compare 2 arraylist elements and set only the elemnts which doesnot match in either of the List.
    For example:-
    List<String> list1 = new ArrayList<String>();
              list1.add("Italy");
              list1.add("US");
              list1.add("England");
              list1.add("Australia");
              list1.add("China");
              List<String> list2 = new ArrayList<String>();
              list2.add("Italy");
              list2.add("US");
              list2.add("England");
              List<String> finalList = new ArrayList<String>();
    for (String country1 : list1) {
              for (String country2 : list2) {
              if (!country1.equalsIgnoreCase(country2)) {
                   finalList.add(country1);
    Here I am comparing both the arraylist elements, and in the FinalList I need capture the elements which are not matching , hence the final List should contains
    Australia and China which is not there in the second arraylist (list2). But the output that is displayed for tha above is wriong as it is comparing the each elemnt of list1 with all the elemnts of list2. Instead I want list1.elemnt[0] not equals list2.elemnt[0] followed by list1.element[1] not equal to list2.element[1] , etc.
    So that i can capture the elements which doesnot match and set it in the finalList. Here the output should be Australia & China. How we can do the above.
    Please clarify.
    Thanks.

    The test is wrong.
    List<String> list1 = new ArrayList<String>();
    list1.add("Italy");
    list1.add("US");
    list1.add("England");
    list1.add("Australia");
    list1.add("China");
    List<String> list2 = new ArrayList<String>();
    list2.add("Italy");
    list2.add("US");
    list2.add("England");
    List<String> finalList = new ArrayList<String>();
    for (String s1 : list1) {
         boolean found = false;
         for (String s2 : list2) {
              if ((s1!=null && s1.equalsIgnoreCase(s2)) || s1==s2) {
                   found = true;
                   break;
         if (!found) finalList.add(s1);
    }or you can generalize the idea and do this:
    static <T> List<T> cmp(List<T> list1, List<T> list2, Comparator<T> comparator) {
         List<T> finalList = new ArrayList<T>();
         for (T s1 : list1) {
              boolean found = false;
              for (T s2 : list2) {
                   if (comparator.compare(s1, s2)==0) {
                        found = true;
                        break;
              if (!found) finalList.add(s1);
         return finalList;
    static final Comparator<String> stringComparator = new Comparator<String>() {
        @Override public int compare(String o1, String o2) { return o1!=null ? o1.compareToIgnoreCase(o2) : o1==o2 ? 0 : -1; }
    static List<String> cmp(List<String> list1, List<String> list2) { return cmp(list1, list2, stringComparator); }
    static void test() {
         List<String> list1 = new ArrayList<String>();
         list1.add("Italy");
         list1.add("US");
         list1.add("England");
         list1.add("Australia");
         list1.add("China");
         List<String> list2 = new ArrayList<String>();
         list2.add("Italy");
         list2.add("US");
         list2.add("England");
         List<String> finalList = cmp(list1, list2);
         for (String s : finalList) System.out.println(s);
    }Carlo

  • Problems comparing two Floats

    Hello all,
    I keep getting exceptions using the code for a table cell renderer listed below.
    Basically, the program blows up whenever the renderer is asked to compare two floats.
    Two string values, a string and a float, it does not have the desired effect, but a least it runs.
    "     public Object[][] aaTableValues = {
              { new Float( 700.00 ), new Float( 300.00 ), new Float( 400.00 ), "Fred", "Snead", "inform", "detail" },
              { new Float( 1000.00 ), new Float( 200.00 ), new Float( 800.00 ), "Jane", "Smith", "limit", "detail" },
              { new Float( 500.00 ), new Float( 200.00 ), new Float( 300.00 ), "Mary", "Ellis", "inform", "detail" },
              table1.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {
                public Component getTableCellRendererComponent(JTable table,
                                                        Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column) {
                    super.getTableCellRendererComponent(table, value, isSelected,
                            hasFocus, row, column);
                    // Prepare default color        
                    Color color = isSelected ? table.getSelectionForeground(): table.getForeground();
                    if (column == 1) {
                        float val1 = 0.0F;
                            val1 = ((Float)value).floatValue();
                        float val2 = ((Float)table.getValueAt(row, column - 1)).floatValue();
                        if( val1 > val2) {
                            color = isSelected ? Color.red.brighter() : Color.red;
                    setForeground(color);
                    return this;
            });I get the runtime exceptions like the following:
    "Caught exception updating ExitableJFrame[frame0,0,0,618x430,invalid,layout=java.awt.BorderLayout,resizable,title=AccountActivityTable,defaultCloseOperation=,rootPane=javax.swing.JRootPane[,0,0,618x430,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=2,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true,EXIT_ON_CLOSE]:
    java.lang.NullPointerException
         at FloatRenderer.getTableCellRendererComponent(Compiled Code)
         at javax.swing.JTable.prepareRenderer(JTable.java:2897)
         at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:968)
         at javax.swing.plaf.basic.BasicTableUI.paintRow(BasicTableUI.java:899)
         at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:811)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:43)
    Does anyone know how to fix this?

    If you look again at the error message, you'll see it's a NullPointerException. You are using a null reference. Nothing at all to do with comparing two float values. I'd guess that "table.getValueAt(row, column - 1)" is returning null, but it's hard to tell without a line number. You need to do some debugging in that code to see where you are using the null reference.

  • VORowImpl problem - comparing two ROW[] lists

    Hi Everyone,
    I have a huge proble right now, I'm trying to compare two VO list with the same values, this is because one it's attached to an advancedtable in the xml page wich the user can change some values, and the other one is from the values of the table but from the DB, the reason is to made a validation to compare the original values from the DB with the list from the tabla and update only the rows that the users made changes in their values, here's my code for a better explain of what I'm doing:
    public void saveChanges(){
    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getDBTransaction();
    Row[] rows1 = getAppVO1().getAllRowsInRange();
    Row[] rows2 = getDBVO1().getAllRowsInRange();
    for(int i = 0; i < rows1.length; i++){
    int j = i;
    //Colections to compare
    //r1: colection from the app
    //r2: colection from BD
    AppVORowImpl r1 = (AppVORowImpl) rows1;
    DBVORowImpl r2 = (DBVORowImpl) rows2[j]; //<--- here in the second iteration appears the following error:
    // "oracle.apps.fnd.framework.OAException: java.lang.ArrayIndexOutOfBoundsException: 1"
    //variables string to check if got changes in the column
    String columnAPP = r1.getId().toString();
    String columnBD = r2.getId().toString();
    //'if' that validates changes
    if(!columnAPP.equals(columnBD)){
    //String variable SP
    StringBuilder procedureCall = new StringBuilder();
    //calling to SP
    try{
    procedureCall.append("... stored proc...");
    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransactionimpl.createCallableStatement(procedureCall.toString(), -1);
    oraclecallablestatement.execute();
    getOADBTransaction().commit();
    }catch(SQLException sqlexception){
    System.err.println("SQL Exception: "+ sqlexception.getMessage());
    getOADBTransaction().rollback();
    throw OAException.wrapperException(sqlexception);
    }catch(Exception e){
    System.err.println("Exception: "+ e.getMessage());
    getOADBTransaction().rollback();
    throw OAException.wrapperException(e);
    the first iteration works fine, but the second and futher shows an exception error, what can I do to make this method works?
    I'll be pending to your answers, I really hope you can help me with this one
    Regards,
    Mentor

    Here is the dump code for you. Code you have to write in AmImpl and call the same from Controller class.
    AMImpl Code
    public void executeBothViewObjects() //Calls this method from Controller *ProcessRequest*
            OAViewObject vo = (OAViewObject)getMainViewObjectVO1();
            OAViewObject dvo = (OAViewObject)getDBViewObjectVO1();
           if (vo != null && dvo != null)
                         //1st VO
                           dvo.setWhereClauseParams(null);
                          //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                          dvo.executeQuery();  
                         //2nd VO
                         vo.setWhereClauseParams(null);
                          //Set where clause if Any  dvo.setWhereClauseParam(0,xx);
                         vo.executeQuery(); 
    public void compareViewObject()   // Calling this method to compare Attribute of both View Object *Process Form Request*
          OAViewObject vo = getMainViewObjectVO1();
          OAViewObject OrigVO = getDBViewObjectVO1();
          MainViewObjectVORowImpl rowi = null;
          DBViewObjectVORowImpl rowii = null;
          int fetchedRowCount = vo.getRowCount();
          int OriginalfetchedRowCount = OrigVO.getRowCount();  
         RowSetIterator originalSelectIter = OrigVO.createRowSetIterator("originalSelectIter");
         RowSetIterator selectIter = vo.createRowSetIterator("selectIter");
         if (fetchedRowCount > 0 && OriginalfetchedRowCount >0)
              selectIter.setRangeStart(0);
              selectIter.setRangeSize(fetchedRowCount);
              originalSelectIter.setRangeStart(0);
              originalSelectIter.setRangeSize(OriginalfetchedRowCount);
              for (int i = 0; i < fetchedRowCount; i++)
                rowi = (MainViewObjectVORowImpl)selectIter.getRowAtRangeIndex(i);
                rowii = (DBViewObjectVORowImpl)originalSelectIter.getRowAtRangeIndex(i);
               //Compare Attribute here
                   if((!(rowi.getRoleStartDate().equals(rowii.getRoleStartDate()))
                            // Comparing Start date here of both View Object
                 else if(((rowi.getRoleEndDate().equals(rowii.getRoleEndDate()))
                       // Comparing End date here of both View Object
    }Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • Compare two text files for matching data

    HI
    I want to compare data in two separate spreadsheet files and store the matching data in another spreadsheet file.
    like
    1)reading data from two spread sheets
    2)compare the data of fist one with second
    3)writing the matched data to third one.
    I am find difficulty in combining them to sort string bu string
    pls help me in this
    thanks
    jyohti

    hi
    i am implementing the following logic
    1)  textfile1--------->string to array
    2)textfile 2--------->string to array
    3) compare the elements (substring) of one array to other using for loop
    4)append the match to an array every time you find a match betwwen two arrays
    5)wriitng the result in new file
    i am strugulling in with 3) i have finshed 1,2,4and 5 th part
    problelms are with indexing and loop conditions for me...
    anyways i am trying and feeling like i will finish and post that soon....

  • Help comparing two ArrayList initializations instructions.

    I found these two methods to initialize ArrayList on a single row in a 3 years old topic here in this forum... so I open a new thread to ask you what you think is the best method I could use. Thank you!
        private static ArrayList<String> strSearchs = new ArrayList<String>(){{add(" state changed from Full to ");}};
        private static ArrayList<String> strSearchs2 = (ArrayList<String>)Arrays.asList(" state changed from Full to ");PS: note that original suggestions was for "List" objects, so I had to add a cast to "ArrayList" in the second instruction.

    Pratically I have such objects which get a String (we can call it "*strOrig*") in the constructor. As result it parse the String, and store all parsed informations in object's variables\attributes.
    Obviously the String is checked to control if it fits some parameters before parsing starts. The static ArrayList contains further requisites (Strings which have to "match" with "*strOrig*" content to confirm it is valid) which are chosen by "the user" (I mean who implements these kind of classes).
    It mean that I need to make the ArrayList modificable (both substituted by another ArrayList variable, or adding, changing and/or removing content for the existing one). I made it static, so it will not create a new ArrayList for every instantiate object.
    So if List can't support add and similar, I think it's not my case. :-S
    Maybe I could instantiate the ArrayList in an AbstractList object, so also Vector could also be used bye "the user"... but this is not very related.
    So maybe private static AbstractList<String> strSearchs = new ArrayList<String>(Arrays.asList(" state changed from Full to ")); is my case...
    Do you agree with me?
    WalterLaan wrote:
    ThePatcha wrote:
    The variable is not intended to be Final, it can be modified via static methods, but I need it's static (so unique for every object instantiated) and it starts with a defaul value already inside.static means the opposite: it is the same for all instances, not unique per instance.My fault: I meant "it's always the same for all instanced objects". I used "unique" instead of "always the same", sorry.
    Edited by: ThePatcha on Feb 2, 2010 6:45 AM

  • Problems syncing photos; they sync in random order not date order.

    Since updating my iPad 2 to iOS 5 my photos won't sync in date order within their folders. They used to stay in the same date order as they are on my PC before the update. I've tried deleting all photos and then putting them all back on but no luck. Any ideas?

    I've checked out lots of the other discussions on this problem and some think it's a change in the ordering in the iOS 5 update; previously they were synced by date but now it's by file name. This doesn't follow for mine though as they aren't syncing in file name order either. Someone suggested trying to rename files which I think I'll try next but I don't hold out much hope! I tried the Genius bar but the "genius" had no ideas! Tried apple support but it wants me to pay a one off fee to get any help. I don't think it's too much to ask to have your photos in chronological order, after all that's what we used to do in good old-fashioned photo albums!
    Nice to hear I'm not the only one frustrated though- thanks for the reply!

  • Comparing two documents created in QuickSilver is not working

    How can I resolve Acrobat 9 not being able to compare PDFs created in QuickSilver? 
    When the user tries the comparison, Acrobat displays a window that reads: "Adobe could not create the report document."
    Thanks in advance!

    Thank you; but, we are in a controlled environment and cannot download/use software that has not been approved.  We are using the most current version (v 9) we are approved to use.

  • Problems with iTunes 8: NBC .m4v shows will not import into iPhone v2.02

    I am a little confused. I have downloaded some NBC shows that are.m4v format, yet they will not import into my iPhone with iTunes 8. I receive the following error msg in iTunes when trying to sync:
    Example "Mr. Monk Buys a House" was not copied to the iPhone
    because it cannot be played on this iPhone.
    Am I doing something wrong? Do I have to convert shows from iTunes to a different format before I can watch them?
    PS Same error msg occurs with iTunes Podcast .mov format.
    Any suggestions?
    Txs

    Well, after a little research in the iTunes Support Browser, Apple finally made the answer available.
    Though Apple designs all products in iTunes to play on iPod type devices, the new HD programming will not.
    The programs that are being "given away for free" are being promoted in HD format, and that's where the links on the iTunes page takes you. The iPhone 3G cannot handle HD programming, and thus the error message. (why couldn't they just have said that in the error msg, rather than have me go and look for half an hour. As my mother used to say, if it looks too good to be true, it probably is.
    A couple of pointers for the free, give-away HD shows from NBC (iTunes way of telling NBC welcome back). These will not work on the iPhone 3G v2.02:
    Mr. Monk Buys a House (HD)
    Merit Badge: Pilot (HD)
    30 Rock: Secrets and Lies (HD)
    Battlestar Galactica, Season 4: He That Believeth in Me (HD)
    etc.
    Yes, if you look close enough in the show description, they are also making these available free in SD. Hope this research saves somebody a headache from buying the wrong programs.
    You're welcome from a friend in Texas!

  • Shall we compare two elements in a collection

    Dear all,
    shall we compare two scuccessive elements in a collection
    i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
    please suggest
    Thank you.
    Suresh

    899511 wrote:
    Dear all,
    shall we compare two scuccessive elements in a collection
    i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
    please suggest
    Thank you.
    SureshDon't do it in a collection. Use SQL.
    SQL provides Lead and Lag analytical function that allow you to compare next/previous values.
    e.g.
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions070.htm
    Loading the data into a collection in memory to do something that can be easily achieved in SQL is just wrong and uses expensive PGA memory unnecessarily.

  • ?Problem of :: "web-app" must match, help me?

    hi,Experts,
    Please do me a big favor, Does anybody know what is the exatly problem with my web.xml.
    My tomcat version is Apache Tomcat/4.1.18.
    here is the web.xml:
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>newGUI</display-name>
    <description>The Database</description>
    <!--Filter Definitions-->
    <filter>
    <filter-name>theFilter</filter-name>
    <filter-class>org.gui.myFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>theFilter</filter-name>
    <url-pattern>/fetch.jsp</url-pattern>
    </filter-mapping>
    <filter>
    <filter-name>theFilter</filter-name>
    <filter-class>org.gui.myFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>theFilter</filter-name>
    <url-pattern>/query.jsp</url-pattern>
    </filter-mapping>
    <!-- Taglib Definitions-->
    <taglib>
    <taglib-uri>
    http://jsptags.com/tags/navigation/pager
    </taglib-uri>
    <taglib-location>
    /WEB-INF/jsp/pager-taglib.tld
    </taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/jstl-c</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/jstl-x</taglib-uri>
    <taglib-location>/WEB-INF/x.tld</taglib-location>
    </taglib>
    </web-app>
    The error message is :
    SEVERE: Parse Error at line 66 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,
    servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,
    resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,
    ejb-local-ref*)".

    It is telling you either you have elements out of order, or elements that do not belong.
    Try to do:
    <filter>
      <filter-name>theFilter</filter-name>
      <filter-class>org.gui.myFilter</filter-class>
    </filter>
    <filter>
      <filter-name>theFilter</filter-name>
      <filter-class>org.gui.myFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>theFilter</filter-name>
      <url-pattern>/fetch.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
      <filter-name>theFilter</filter-name>
      <url-pattern>/query.jsp</url-pattern>
    </filter-mapping>Then double check spelling and such.

  • Compare two strings for partial or full match

    I have been trying to figure out away of comparing two strings.
    I can get the full string matching to successfully work but am struggling on how to get partial eg wildcard search working.
    say I had names like paul Duncan, George Morrison.
    I have split them up so its now paul , duncan i then use the users entered string to compare it against the name name to see if it matches anything in the first name or the last name if it does i added it to an arraylist.
    however i have tried t use a indexof as i believe this looks for similarity (Substring matches?) but it always returns -1.
    Could anyone possibly direct me to a method that will allow me to use partial text string to match it against stored user names.
    eg user enters pa
    I would return anything that would contain pa
    thanks for any help

    thank you for the reply
    Sorry I forgot to put in the code.
    This is a reduced down version including the read in from a text file as well as the index of if statement and the adding of it to an array list.
    public class FindContact {
    String res;
    /** Creates a new instance of FindContact */
    public FindContact() {
    public Object[] FindAUser(String passSearch) {
    System.out.println("getting here");
    ArrayList found = new ArrayList();
    String patternStr = ",";
    int j, i = 0;
    try {
    BufferedReader in = new BufferedReader(new FileReader("H:\\out.txt"));
    String str;
    while ((str = in.readLine()) != null) {
    String[] fields = str.split(patternStr);
    //for(j=0;j < fields.length;j++) {
    if (fields.length != 0) {
    if (passSearch.indexOf(fields[0])!=-1 || passSearch.indexOf(fields[1])!=-1) {
    found.add(str);
    System.out.println("ENDDDDDDDD value ");
    in.close();
    } catch (IOException e) {
    System.out.println(e.toString());
    Object[] foundResult = new Object[found.size()];
    foundResult = found.toArray();
    if (foundResult.length >= 0) {
    System.out.println(foundResult.length);
    return foundResult;
    Hope that helps as it has confused me and am not sure why it is not returning a value.
    Should I maybe use the contain method instead to search for the user inputted string?

  • Motion tracking: matching two tracked elements

    Hi all,
    In slightly over my head... searched high and low... but I am stuck.
    I have two video elements in a composition, both VERY similar, but they don't track perfectly.
    What I tried to do was taking the tracking data from one element, and subtracting the tracking from the second element in expressions (to get a delta), and then apply the difference to the anchor point of the element.  This did not work... as I expected.
    I have two good tracks, but I can't figure out how to get these tracks to work together (they are tracking the exact same point) to match them.  Is this a match move problem?
    Please help.  Thank you.

    Thank you Mathias,
    I can't stabalize because the shots both pan.
    Imagine a dolly shot... moving smoothly though a scene.  That is shot A
    Imagine a second dolly shot, on the same track, of the same scene.  That is shot B
    Imagine that the dolly operator could not perfectly dolly the camera for each shot (how could they?).
    But they are close.
    I can pick the exact same track point on the dolly shot... so that gives me data on each dolly shot.
    As you can see, there is nothing to stabalize.  Both shots are stable... they just track differently, slightly.
    I am not using mocha.... this is a perfect 2D track situation.
    I tried vector subtraction in expressions, subtracting tracker A from tracker B... that number should be the difference between the dolly shots, yes?
    Now, if I use THAT number to offset one of the shots... that should cause them to realign, yes?
    I feel I am close...
    I am using the sub(v1,v2) expressions function.
    This is probably simple, I'm just being thick headed about it somehow.

  • Org.xml.sax.SAXParseException: Document root element "taglib", must match D

    hi
    using tomcat 4
    and jdf1.5
    i am getting bellow error
    org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".

    Check your web.xml once again.

  • Failed to compare two elements in the array

    very often, I have the error "Failed to compare two elements in the array" in Exchange 2013 ECP. We are not running DAG. I google a bit but don't get a lot of result on this.
    I was trying to track mail from a user who send to DL group. Since I can't do in in ECP , how can I do it in EMS?

    I too have this issue.  I'm not sure how wide spread.  I know of one user who sends emails regularly to a DL named "All Users" which is a Security Group which we then add real users to and not just every mailbox.  When he sends the emails,
    from his perspective, everything is fine, meaning he gets to NDR or anything.  Also, when he adds the Dl in Outlook To field and expands it, all the correct users are there.  In fact, it tells him there are 203 addresses here.  However, only
    184 are actually getting the message.  When I try the EAC to view the tracking report, it will show the message, but if I click on the edit button, I get "Failed to compare two elements in the array".  If I try from EMC with search-messagetrackingreport
    -identity "recipient address" -sender "sender address" -bypassdelegatechecking and the recipient address is the group, it says it could not be found.  If I try with simply putting an email address of someone who is a member of that group, it says Warning:
    An unexpected error has occured and a Watson dump is being generated.  Failed to compare two elements in the array.  I don't know what else to try.  Anybody??

Maybe you are looking for