#vulnerable code 
                                Object getRandomPrimitiveArray(final Class<?> primitiveType) {
        int size = abs(aNewByteRandomizer().getRandomValue());
        // TODO A bounty will be offered to anybody that comes with a generic template method for that..
        if (primitiveType.equals(Byte.TYPE)) {
            byte[] result = new byte[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Byte.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Short.TYPE)) {
            short[] result = new short[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Short.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Integer.TYPE)) {
            int[] result = new int[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Integer.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Long.TYPE)) {
            long[] result = new long[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Long.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Float.TYPE)) {
            float[] result = new float[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Float.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Double.TYPE)) {
            double[] result = new double[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Double.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Character.TYPE)) {
            char[] result = new char[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Character.TYPE);
            }
            return result;
        }
        if (primitiveType.equals(Boolean.TYPE)) {
            boolean[] result = new boolean[size];
            for (int index = 0; index < size; index ++) {
                result[index] = enhancedRandom.nextObject(Boolean.TYPE);
            }
            return result;
        }
        return null;
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                ArrayPopulator(final EnhancedRandomImpl enhancedRandom) {
        this.enhancedRandom = enhancedRandom;
    }