I ran into a super-annoying iCloud drive sync issue this weekend when setting up a new MacBook Pro. Not 100% sure how I got into the scenario but basically, the system ended up throwing a bunch of files on my desktop that I wanted to get rid of, and then when I deleted them, they'd just come right back a few minutes later!
The solution was to turn off iCloud drive sync, wait a few moments, then turn it back on. The files came back, but this time, the ones I wanted to get rid of stayed deleted when I removed them.
I suspect that the sync got, uh, out of sync due to iCloud not quite being done with the initial setup sync when I removed the files. So when it saw they were gone, it didn't realize it was intentional and kept trying to bring them back. In any case, super glad that this variation of "turn it off and back on again" really did clear up the problem :-)
And interfaces can have default methods. And that means that enums with a similar use can avoid copy-pasting code, by implementing the appropriate interface.
I love enums. They're a great tool for ensuring something exists exactly once, but maybe it has a few brothers and sisters.
What I hate about enums is that Java refuses to let us subclass them, and refuses to let us inherit from a class of our own choice, because it already inherits from a class by design, and Java refuses to allow multiple inheritance.
The pain is great and has led to duplicate code in my past.
Until today. Because today I learned from people on StackOverflow that enums can implement interfaces.
I should have realized that years ago. But I'm happy to know it now, and I hope some of you will be helped by this, as well.