Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-288

NoSuchElementException in org.apache.bcel.generic.InvokeInstruction.toString()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.0
    • Fix Version/s: None
    • Component/s: Main
    • Labels:
      None

      Description

      When I run JasminVisitor example I get:

      java.util.NoSuchElementException
      	at java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
      	at org.apache.bcel.generic.InvokeInstruction.toString(InvokeInstruction.java:59)
      

      Possible bug fix in `org.apache.bcel.generic.InvokeInstruction`, add ":" as delimiter in the `java.util.StringTokenizer`:

          /**
           * @return mnemonic for instruction with symbolic references resolved
           */
          @Override
          public String toString( final ConstantPool cp ) {
              final Constant c = cp.getConstant(super.getIndex());
              final StringTokenizer tok = new StringTokenizer(cp.constantToString(c), ":");
              return Const.getOpcodeName(super.getOpcode()) + " " + tok.nextToken().replace('.', '/')
                      + tok.nextToken();
          }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ggeorg George Georgopoulos
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: