Comparison Silently fails when class capitalization different between local & server

Issue #2459 resolved
Justin Julicher created an issue

I have a situation on a legacy system the capitalization of classes was inconsistent between the metadata and the instance.

Locally the class started with a lower case but the server version had an upper case.

When trying to do a comparison either through ‘compare with …' or in the retrieval dialog it would silently fail (even with no error in the log).

I discovered this, because separately, I was doing a deployment with a destructive changes package and it seems the destructive changes are case sensitive (although I thought everything apex was meant to be case-insensitive).

2 things here:

  • The deploy & retrieval dialogs display the server version only (but don’t show the local version if there is a case mismatch). Not sure if this is correct?
  • Is it possible to have the comparison work on a case insensitive basis and not silently fail?

Comments (6)

  1. Scott Wells repo owner
    • changed status to open

    Yeah, some of this is likely due to the fact that IC2 also has to take into consideration the possibility of a case-insensitive local filesystem, specifically on Windows. Given that, for the most part, the Salesforce APIs also allow case-insensitivity on metadata type and object names, right now IC2 pretty much always performs case-insensitive comparisons of those names. To be honest, I'd be pretty loathe to change that approach since it addresses way more issues than it potentially causes, and the internal code branching that would be required to be case-sensitive in those rare instances where it matters vs. all the ones where it doesn't would result in some heinous code (even with proper encapsulation). I think the "and not silently fail" is the important part here. Can you provide specific steps to reproduce this behavior? If so, I'll see if I can at least make it behave better than it does now...

  2. Justin Julicher reporter

    hmm.. not sure the exact steps …

    • Set up a sandbox with a class. say ‘TestCapitalization’.
    • Locally have the class as testCapitalization.
    • Try and do a comparison of the local file with the server file.

  3. Scott Wells repo owner

    I just renamed the files for a class locally to be foo.cls and foo.cls-meta.xml where both on the server and in the file contents itself the class is named Foo, and I was able to compare that class with the server on both Windows (case-insensitive filesystem) and Mac (case-sensitive filesystem). Please let me know if I’m not trying to reproduce this correctly.

  4. Scott Wells repo owner

    Resolving due to lack of activity. If this is still happening, feel free to reopen with additional diagnostic information.

  5. Log in to comment