3 Replies Latest reply on May 3, 2004 10:45 AM by chiba

    Removing a Method

    mardoqueu

      Is it possible to remove the definition of a Method from a class?

        • 1. Re: Removing a Method
          chiba

          Currently no because removing a method
          may cause binary incompatibility (it is usually
          unsafe).

          However, if you really need this, I will add it
          to Javassist 3.0, which will be released soon.
          Can you tell me why you need it? For
          reducing the size of a class file?

          • 2. Re: Removing a Method
            msvieira

            I really need this, because I am developing a Java class stub generation tool, that is, the result of the removal of all private class members and the removal of the implementation of all public methods.

            So I will not have compatibility problems.

            I am looking for a tool to help me in this challenge.

            Thanks for the answer.
            Mardoqueu.
            PS: I sent que question with another user login.

            • 3. Re: Removing a Method
              chiba

              I see.
              But for that purpose, it might be simpler
              to create a new empty class and copy
              all public members from the original
              to the stub class.