I have created a method to parse a JSON object and to return an array of string.

```
private String[] getAttributesfromJson(JSONObject attacheddataattributejson) {
    String returnjsonArray[] = null;
    JSONArray subcatarray = attacheddataattributejson.optJSONArray("subcatAttributes");
    if(subcatarray!=null){
        for(int i=0;i<subcatarray.length();i++)
        {
            returnjsonArray[i]=subcatarray.getJSONObject(i).optString("name");
        }   
    }
    return returnjsonArray;
}

```

But my eclipse is showing an warning on returnjsonArray[i] that this can only be null at this pos. But I have a null check for subcatarray also. Please help.