Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SequencedHashMap in 6.5.1 vs LinkedMap in 8.0

    Hi,

    We appear to be sort of stuck while trying to evaluate 8.0. Our server-side code when working with 6.5.1 requires us to use SequencedHashMap. However, when we try that code with 8.0, we get ClassCast exceptions that require us to change all SequencedHashMaps to LinkedMaps. But, when try to use LinkedMaps with 6.5.1, we are required to use SequencedHashMaps?

    So, is there any solution that will work with both SmartClient versions without us resorting to some sort of Dynamic casting based on which version of Smartclient we are running?

    #2
    How did you become dependent on SequencedHashMap? It was a class we use internally, where the documented APIs just indicate they return Map.

    Comment


      #3
      At this point, it doesn't completely matter does it? If it does, I can send you code samples later on. If we need to do some dynamic casting, so be it. Let me know.

      Comment


        #4
        Well, the preferred solution is really to remove any references to the more specific Sequenced/LinkHashMap entirely, since this sounds like it's a reliance on undocumented behavior. But if there's some legitimate usage of this kind, they yes, use dynamic casting.

        Comment


          #5
          We built our own Export functionality before you guys baked it into the product. And, unfortunately the developer who did all this work is no longer with us. But, he ended up using SequencedHashMap extensively to get it done.

          here is one sample of what he did to pass back detailed data about the grid and datasource info and other user variables:

          Code:
          				if (req instanceof RPCRequest) {
          					RPCRequest rpcreq = (RPCRequest)req;
          					ArrayList rpcData;
          					rpcData = (ArrayList)rpcreq.getData();
          					
          					SequencedHashMap browserInfo = (SequencedHashMap) rpcData.get(1);
          					requestUserEmail = browserInfo.get("requestUserEmail").toString().trim();

          There are hundreds of references to SequencedHashMap used to pull data out of these Export requests from the client. So, based on that, sounds like we should just go with Dynamic casting? Converting to your export functionality is not feasible in the near future.

          Comment


            #6
            To be honest, this developer needs to go to a class on Java. There's no evident reason, in this code at least, why he's using concrete types like ArrayList and SequencedHashMap instead of interface types like List and Map. You should be able to correct his code with a little search and replace.

            Comment

            Working...
            X