Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2088

Inconsistent stack height when using super inside a conditional

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-beta-2
    • 1.1-beta-2
    • None
    • None
    • java.version: 1.6.0_02
      os.name: Windows XP

    Description

      When having a class like this:
      ************************************************************************************************
      public class RedirectOperation extends XMLOperation
      {
      protected void _processXML(
      StreamSource xmlSource,
      XMLOperationDescriptor theXMLOperationDescriptor,
      HttpServletRequest request,
      HttpServletResponse response,
      ServletContext theContext,
      Hashtable theParameters,
      Hashtable theEnvironment)
      throws TransformerException, IOException, OperationException
      {
      def doc = new XmlParser().parse(xmlSource.getInputStream())
      xmlSource.getInputStream().reset()
      def redirectURL = doc.REDIRECT_URL.'@Url'
      if(redirectURL[0])

      { response.sendRedirect(redirectURL[0]) }

      else

      { super._processXML( xmlSource, theXMLOperationDescriptor,request,response,theContext,theParameters,theEnvironment); }

      }
      }
      ************************************************************************************************
      Class is compiled and the .class file used. Executing the method on an instance raises this error:
      java.lang.VerifyError: (class: es/uib/test/RedirectOperation, method: _processXML
      signature:
      (Ljavax/xml/transform/stream/StreamSource;Lorg/leaf/XMLOperationDescriptor;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/ServletContext;Ljava/util/Hashtable;Ljava/util/Hashtable;)V)
      Inconsistent stack height 1 != 0
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      ...

      If, for example, one removes the "else" clause and places a return at the end of the if clause, then everything works as expected.

      Verified with Groovy 1.0 and Groovy 1.1b2
      Groovy script compiled through the Eclipse plugin

      S!

      Attachments

        Activity

          People

            Unassigned Unassigned
            greeneyed Daniel Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: