#vulnerable code 
                                protected boolean hasImport(String name) {
        if (getParserContext().hasImport(name)) {
            return true;
        }
        else {
            VariableResolverFactory vrf = findClassImportResolverFactory(variableFactory);
            return vrf != null && vrf.isResolveable(name);
        }
    } 
                            #location 2 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                protected boolean hasImport(String name) {
        if (pCtx == null) pCtx = getParserContext();

        if (pCtx.hasImport(name)) {
            return true;
        }
        else {
            VariableResolverFactory vrf = findClassImportResolverFactory(variableFactory);
            return vrf != null && vrf.isResolveable(name);
        }
    }