java.lang.NullPointerException

Atlassian JIRA | Jed Wesley-Smith | 9 years ago
  1. 0

    FieldLayoutSchemeImpl.java has a number of thread-safety issues. Firstly it uses a HashMap as its cache and does not synchronise access or mutable operations. Fortunately it doesn't get mutated very often so we don't see problems with this very often. Worse is that it suffers from a race-condition at startup, where it is lazily initialised. This initialisation depends on the nullness of the {{schemeEntities}} reference, but other threads can see a partially initialised schemeEntities cache, which if it doesn't have the default entry in it yet leads to the following: {noformat} [webwork.util.ServletValueStack] METHOD: "fieldHidden", exception: java.lang.NullPointerException at com.atlassian.jira.issue.fields.layout.field.FieldLayoutSchemeImpl.getFieldLayoutId(FieldLayoutSchemeImpl.java:107) at com.atlassian.jira.issue.fields.layout.field.enterprise.EnterpriseFieldLayoutManager.getFieldLayout(EnterpriseFieldLayoutManager.java:73) at com.atlassian.jira.web.bean.FieldVisibilityBean.isFieldHidden(FieldVisibilityBean.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... {noformat} Also, the access to the schemeEntities reference itself is not safe, so it is possible multiple threads could be initialising multiple schemeEntities maps. Please note that {{null}} has a special value in this map, so ConcurrentHashMap is not a drop-in replacement, and doesn't fix the visibility and unsafe publication problems.

    Atlassian JIRA | 9 years ago | Jed Wesley-Smith
    java.lang.NullPointerException
  2. 0

    FieldLayoutSchemeImpl.java has a number of thread-safety issues. Firstly it uses a HashMap as its cache and does not synchronise access or mutable operations. Fortunately it doesn't get mutated very often so we don't see problems with this very often. Worse is that it suffers from a race-condition at startup, where it is lazily initialised. This initialisation depends on the nullness of the {{schemeEntities}} reference, but other threads can see a partially initialised schemeEntities cache, which if it doesn't have the default entry in it yet leads to the following: {noformat} [webwork.util.ServletValueStack] METHOD: "fieldHidden", exception: java.lang.NullPointerException at com.atlassian.jira.issue.fields.layout.field.FieldLayoutSchemeImpl.getFieldLayoutId(FieldLayoutSchemeImpl.java:107) at com.atlassian.jira.issue.fields.layout.field.enterprise.EnterpriseFieldLayoutManager.getFieldLayout(EnterpriseFieldLayoutManager.java:73) at com.atlassian.jira.web.bean.FieldVisibilityBean.isFieldHidden(FieldVisibilityBean.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... {noformat} Also, the access to the schemeEntities reference itself is not safe, so it is possible multiple threads could be initialising multiple schemeEntities maps. Please note that {{null}} has a special value in this map, so ConcurrentHashMap is not a drop-in replacement, and doesn't fix the visibility and unsafe publication problems.

    Atlassian JIRA | 9 years ago | Jed Wesley-Smith
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.jira.issue.fields.layout.field.FieldLayoutSchemeImpl.getFieldLayoutId()
    2. com.atlassian.jira
      FieldVisibilityBean.isFieldHidden
      1. com.atlassian.jira.issue.fields.layout.field.FieldLayoutSchemeImpl.getFieldLayoutId(FieldLayoutSchemeImpl.java:107)
      2. com.atlassian.jira.issue.fields.layout.field.enterprise.EnterpriseFieldLayoutManager.getFieldLayout(EnterpriseFieldLayoutManager.java:73)
      3. com.atlassian.jira.web.bean.FieldVisibilityBean.isFieldHidden(FieldVisibilityBean.java:163)
      3 frames
    3. Java RT
      NativeMethodAccessorImpl.invoke0
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      1 frame