You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 14:13:15 UTC

[jira] [Updated] (BCEL-78) NullPointerException in InstructionHandle

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

Emmanuel Bourg updated BCEL-78:
-------------------------------

      Description: 
please add missing checks for null references in InstructionHandle.java to 
avoid null pointer exceptions:

A) in line 161
{code}
  /**
   * Denote this handle isn't referenced anymore by t.
   */
  public void removeTargeter(InstructionTargeter t) {
==ADD==>    if (targeters != null)
      targeters.remove(t);
  }
{code}

B) in line 238
{code}
  /** @return all attributes associated with this handle
   */
  public Collection getAttributes() {
==ADD==>    if(attributes == null)
==ADD==>      attributes = new HashMap(3);
    return attributes.values();
  }
{code}

  was:
please add missing checks for null references in InstructionHandle.java to 
avoid null pointer exceptions:

A) in line 161

  /**
   * Denote this handle isn't referenced anymore by t.
   */
  public void removeTargeter(InstructionTargeter t) {
==ADD==>    if (targeters != null)
      targeters.remove(t);
  }

B) in line 238

  /** @return all attributes associated with this handle
   */
  public Collection getAttributes() {
==ADD==>    if(attributes == null)
==ADD==>      attributes = new HashMap(3);
    return attributes.values();
  }

         Priority: Major
      Environment:     (was: Operating System: All
Platform: All)
    Fix Version/s: 5.2
         Priority:   (was: P2)
         Severity:   (was: normal)
          Summary: NullPointerException in InstructionHandle  (was: nullpointer exception in InstructionHandle)

> NullPointerException in InstructionHandle
> -----------------------------------------
>
>                 Key: BCEL-78
>                 URL: https://issues.apache.org/jira/browse/BCEL-78
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.1
>            Reporter: bergrei
>            Assignee: Apache Commons Developers
>             Fix For: 5.2
>
>
> please add missing checks for null references in InstructionHandle.java to 
> avoid null pointer exceptions:
> A) in line 161
> {code}
>   /**
>    * Denote this handle isn't referenced anymore by t.
>    */
>   public void removeTargeter(InstructionTargeter t) {
> ==ADD==>    if (targeters != null)
>       targeters.remove(t);
>   }
> {code}
> B) in line 238
> {code}
>   /** @return all attributes associated with this handle
>    */
>   public Collection getAttributes() {
> ==ADD==>    if(attributes == null)
> ==ADD==>      attributes = new HashMap(3);
>     return attributes.values();
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)