I have a 1GP
Managed Packaged with Released Versions (but no customers only Dev orgs) and it contains a global
class with various abstract
methods that subscribers could override.
global with sharing abstract class MyApi {
// ABSTRACT
global abstract void anOperation(...);
global abstract void anotherOperation(...);
...
}
Now I tried adding another global abstract method but it fails to deploy in the Packaging org with:
Cannot add new final methods to virtual or abstract classes
Until now, I didn't know if this seemingly undocumented restriction that you can not extend global classes by adding more restrictions.
Question: What are my options to mitigate that?
- Can I leverage @deprecated in any way?
- Should I simply kill this class and invent a new one? Including refactoring all my code?
- Should I switch to 2GP? Not sure if that is even possible?
- Is there other ways I am currently not thinking of?