#vulnerable code 
                                public void testBasicPoolEntry() {
        HttpRoute route = new HttpRoute(TARGET);
        ClientConnectionOperator ccop =
            new DefaultClientConnectionOperator(supportedSchemes);

        BasicPoolEntry bpe = null;
        try {
            bpe = new BasicPoolEntry(null, null, null);
            fail("null operator not detected");
        } catch (NullPointerException npx) {
            // expected
        } catch (IllegalArgumentException iax) {
            // would be preferred
        }

        try {
            bpe = new BasicPoolEntry(ccop, null, null);
            fail("null route not detected");
        } catch (IllegalArgumentException iax) {
            // expected
        }

        bpe = new BasicPoolEntry(ccop, route, null);
        assertEquals ("wrong operator", ccop, bpe.getOperator());
        assertEquals ("wrong route", route, bpe.getPlannedRoute());
        assertNotNull("missing ref", bpe.getWeakRef());

        assertEquals("bad weak ref", bpe, bpe.getWeakRef().get());
        assertEquals("bad ref route", route, bpe.getWeakRef().getRoute());
    } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public void testBasicPoolEntry() {
        HttpRoute route = new HttpRoute(TARGET);
        ClientConnectionOperator ccop =
            new DefaultClientConnectionOperator(supportedSchemes);

        BasicPoolEntry bpe = null;
        try {
            bpe = new BasicPoolEntry(null, null, null);
            fail("null operator not detected");
        } catch (NullPointerException npx) {
            // expected
        } catch (IllegalArgumentException iax) {
            // would be preferred
        }

        try {
            bpe = new BasicPoolEntry(ccop, null, null);
            fail("null route not detected");
        } catch (IllegalArgumentException iax) {
            // expected
        }

        bpe = new BasicPoolEntry(ccop, route, null);
        assertEquals ("wrong route", route, bpe.getPlannedRoute());
        assertNotNull("missing ref", bpe.getWeakRef());

        assertEquals("bad weak ref", bpe, bpe.getWeakRef().get());
        assertEquals("bad ref route", route, bpe.getWeakRef().getRoute());
    }