Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-420

Javaflow has a problem when the suspended function is invoked using reflection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Nightly Builds
    • None
    • Javaflow
    • None
    • Debian linux using Sun JDK 1.6 and asm 4.0_RC2

    Description

      I have a fn which has a code as below:

      private void callsomeshared()
      throws Exception
      {
      Method mthd = _someShared.getDeclaredMethod("doSomething");
      int cnt = 0;
      while (cnt < 10)

      { mthd.invoke(_shared); //Continuation.suspend(); cnt++; }

      }

      The doSomething does this:
      public boolean doSomething()
      throws Exception
      {
      if (_shared.value() < 10)

      { _shared.echo(); Continuation.suspend(); }

      return (_shared.value() < 10);
      }

      Doing this, fails with a ClassCastException, since when it hits the Method.invoke, it is potentially popping out the AnotherLoader class and does not have the Method class pushed.

      Attachments

        1. ContinuationMethodAdapter.java
          16 kB
          Raji Sankar
        2. ContinuationMethodAnalyzer.java
          17 kB
          Raji Sankar
        3. ContinueReflection.java
          1 kB
          Raji Sankar

        Activity

          People

            Unassigned Unassigned
            rsankarx Raji Sankar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: