#fixed code
                                @SuppressWarnings("unchecked")
    static <T, S extends Geometry> List<Entry<T, S>> createEntries(Node_ node,
            Func1<byte[], T> deserializer) {
        List<Entry<T, S>> list = new ArrayList<Entry<T, S>>(node.entriesLength());
        for (int i = 0; i < node.entriesLength(); i++) {
            Entry_ entry = node.entries(i);
            Geometry_ g = entry.geometry();
            final Geometry geometry;
            if (g.type() == GeometryType_.Box) {
                Box_ b = g.box();
                geometry = Rectangle.create(b.minX(), b.minY(), b.maxX(), b.maxY());
            } else if (g.type() == GeometryType_.Point) {
                Point_ p = g.point();
                geometry = Point.create(p.x(), p.y());
            } else if (g.type() == GeometryType_.Circle) {
                Circle_ c = g.circle();
                geometry = Circle.create(c.x(), c.y(), c.radius());
            } else
                throw new RuntimeException("unexpected");
            ByteBuffer bb = entry.objectAsByteBuffer();
            byte[] bytes = Arrays.copyOfRange(bb.array(), bb.position(), bb.limit());
            list.add(EntryDefault.<T, S> entry(deserializer.call(bytes), (S) geometry));
        }
        return list;
    }
#vulnerable code 
                                @SuppressWarnings("unchecked")
    static <T, S extends Geometry> List<Entry<T, S>> createEntries(Node_ node,
            Func1<byte[], T> deserializer) {
        List<Entry<T, S>> list = new ArrayList<Entry<T, S>>(node.entriesLength());
        for (int i = 0; i < node.entriesLength(); i++) {
            Entry_ entry = node.entries(i);
            Geometry_ g = node.entries(i).geometry();
            final Geometry geometry;
            if (g.type() == GeometryType_.Box) {
                Box_ b = g.box();
                geometry = Rectangle.create(b.minX(), b.minY(), b.maxX(), b.maxY());
            } else if (g.type() == GeometryType_.Point) {
                Point_ p = g.point();
                geometry = Point.create(p.x(), p.y());
            } else if (g.type() == GeometryType_.Circle) {
                Circle_ c = g.circle();
                geometry = Circle.create(c.x(), c.y(), c.radius());
            } else
                throw new RuntimeException("unexpected");
            ByteBuffer bb = entry.objectAsByteBuffer();
            byte[] bytes = Arrays.copyOfRange(bb.array(), bb.position(), bb.limit());
            list.add(EntryDefault.<T, S> entry(deserializer.call(bytes), (S) geometry));
        }
        return list;
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE