commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Georgopoulos (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-288) NoSuchElementException in org.apache.bcel.generic.InvokeInstruction.toString()
Date Sun, 26 Feb 2017 17:12:45 GMT

     [ https://issues.apache.org/jira/browse/BCEL-288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

George Georgopoulos updated BCEL-288:
-------------------------------------
    Description: 
When I run JasminVisitor example I get:
{code}
java.util.NoSuchElementException
	at java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
	at org.apache.bcel.generic.InvokeInstruction.toString(InvokeInstruction.java:59)
{code}

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

{code:java}
    /**
     * @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();
    }
{code}

  was:
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();
    }
```


> NoSuchElementException in org.apache.bcel.generic.InvokeInstruction.toString()
> ------------------------------------------------------------------------------
>
>                 Key: BCEL-288
>                 URL: https://issues.apache.org/jira/browse/BCEL-288
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 6.0
>            Reporter: George Georgopoulos
>
> When I run JasminVisitor example I get:
> {code}
> java.util.NoSuchElementException
> 	at java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
> 	at org.apache.bcel.generic.InvokeInstruction.toString(InvokeInstruction.java:59)
> {code}
> Possible bug fix in `org.apache.bcel.generic.InvokeInstruction`, add ":" as delimiter
in the `java.util.StringTokenizer`:
> {code:java}
>     /**
>      * @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();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message