Apex Code Items that Are Not Versioned

You can change the behavior of some Apex items across package versions. For example, you can deprecate a method so that new subscribers can no longer reference the package in a subsequent version.

However, the following list of modifiers, keywords, and annotations cannot be versioned. If a package developer makes changes to one of the following modifiers, keywords, or annotations, the changes are reflected across all package versions.

There are limitations on the changes that you can make to some of these items when they are used in Apex code in managed packages.

Package developers can add or remove the following items:

  • @future
  • @isTest
  • with sharing
  • without sharing
  • transient

Package developers can make limited changes to the following items:

  • private—can be changed to global
  • public—can be changed to global
  • protected—can be changed to global
  • abstract—can be changed to virtual but cannot be removed
  • final—can be removed but cannot be added

Package developers cannot remove or change the following items:

  • global
  • virtual
Package developers can add the webService keyword, but once it has been added, it cannot be removed.
Note

Note

You cannot deprecate webService methods or variables in managed package code.

Previous
Next