Uploaded image for project: 'Cocoon 3 (Retired)'
  1. Cocoon 3 (Retired)
  2. COCOON3-23

StackOverflowError on CachingPipeline.setup(OutputStream)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-1
    • 3.0.0-alpha-2
    • cocoon-pipeline
    • None

    Description

      CachingPipeline.setup(OutputStream) calls itself resulting in a StackOverflowError [1]. I suppose that it should create a CachingOutputStream first and then call super.setup like setup(OutputStream outputStream, Map<String, Object> parameters) does [2]. [3] is a short code fragment to reproduce.

      [1]
      @Override
      public void setup(OutputStream outputStream) {
          this.setup(outputStream);
      }

      [2]
      @Override
      public void setup(OutputStream outputStream, Map<String, Object> parameters) {
           // create a caching output stream to intercept the result
           this.cachingOutputStream = new CachingOutputStream(outputStream);

           super.setup(this.cachingOutputStream, parameters);
      }

      [3]
      Pipeline pipeline = new CachingPipeline();
      pipeline.addComponent(new StringGenerator("<x></x>"));
      pipeline.addComponent(new XMLSerializer());

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      pipeline.setup(baos);
      pipeline.execute();

      Attachments

        1. cocoon3-23.patch
          1 kB
          Steven Dolg

        Activity

          People

            steven.dolg Steven Dolg
            alexanderdaniel Alexander Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: