Apex Code Items That Aren’t Versioned
Some Apex items in managed packages can’t be versioned. The changes that you make to
these items are reflected across all package versions. Additionally, there are limitations to
the changes that you can make to some of these items when they are used in Apex code in managed
packages.
As a package developer, you can add or remove these items from Apex in manage packages.
- @Future
- @IsTest
- with sharing
- without sharing
- transient
You can make limited changes to these Apex items in managed packages.
- private—can be changed to global
- protected—can be changed to global
- public—can be changed to global
- abstract—can be changed to virtual but can’t be removed
- final—can be removed but can’t be added
You can’t remove or change these Apex items in managed packages.
- global
- virtual
You can add the webservice keyword, but once it has been added, it can’t be removed.
If a package upgrade includes an explicit global constructor for a released global class that previously only had an implicit constructor, then the new, explicit constructor will be called from the subscriber. Also, you can’t reduce the access modifier on the default constructor on a released global class in a package. See Best Practices for Using Global Apex in Managed Packages.