8

We have 2 managed packages. Let's name those MPMAIN and MPCHILD. MPCHILD package is dependent on MPMAIN.

In MPCHILD we have a class:

@deprecated
global class ChildClass extends MPMAIN.MainClass {
    ...
}

MainClass in MPMAIN v.1 had a body without an explicitly specified constructor:

global abstract with sharing class MainClass {
    ...

    // No constructor here.

    ...
}

Later we released a new version of MPMAIN v.2 with changed MainClass:

global abstract with sharing class MainClass {
    ...

    global MainClass() {
        ...
    }

    ...
}

When we installed the new version MPMAIN v.2 into MPCHILD instance we started to get an error message when we compile all classes:

ChildClass: line 2, column 14: Method is not visible: void MPMAIN.MainClass.()

ChildClass is still pointed to v.1 of MPMAIN package. And we can't change it as the ChildClass is deprecated. If I try to change MPMAIN package version I get the error:

Compile Error: A class with name MPCHILD.ChildClass was deprecated for this package or this name is already in use! at line -1 column -1

We reverted the MPCHILD package from Release to Beta but still can't remove @deprecated for ChildClass.

Compile Error: Previously annotated identifier with @Deprecated must still be annotated: MPCHILD.ChildClass at line 1 column 14

I guess we see this error message because the ChildClass is global. But how can we resolve the issue?

  • If you want to do that you will have to refactor the child to not use the deprecated method. Otherwise you are stuck at the earlier version – Eric Aug 22 '18 at 7:44
  • But how can I remove the deprecated. The child class is not used anywhere. – Mikhail Ivanov Aug 22 '18 at 8:01
  • I guess we can't remove the @deprecated because the class is global. But we must fix the issue somehow. Any idea? – Mikhail Ivanov Aug 22 '18 at 8:05
  • Are you able to raise a support case for this? Long term it seems like a compiler issue. – Daniel Ballinger Aug 28 '18 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.