@@ -0,0 +1,1716 @@
+package sfBugs;%0A%0Aimport java.lang.reflect.Constructor;%0Aimport java.lang.reflect.InvocationTargetException;%0A%0Aimport edu.umd.cs.findbugs.annotations.DesireNoWarning;%0A%0Apublic class Bug3479080 %7B%0A    @DesireNoWarning(%22NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH%22)%0A    public Object doit()%0A    %7B%0A        Object targetClass = %22java.lang.String%22;%0A%0A        Class c = null;%0A%0A        try%0A        %7B%0A            // Allow the class to be specified as a String instead of%0A            // passed-in as a java.lang.Class object.%0A            if(targetClass instanceof String)%0A                c = Class.forName((String)targetClass);%0A            else if(targetClass instanceof Class)%0A                c = (Class)targetClass;%0A            else%0A                throw new RuntimeException(%22Can't create class from %22 + targetClass);%0A%0A            Constructor constructor = getConstructor(c);%0A%0A            if(null == constructor)%0A                throw new RuntimeException(%22No such constructor found in class %22 + c.getName());%0A%0A            return constructor.newInstance((Object%5B%5D)null);%0A        %7D%0A        catch (IllegalAccessException iae)%0A        %7B%0A            throw new RuntimeException(%22Cannot create object of type %22 + c, iae);%0A        %7D%0A        catch (InvocationTargetException ite)%0A        %7B%0A            throw new RuntimeException(c.getName() + %22.%3Cinit%3E failed%22, ite.getCause());%0A        %7D%0A        catch (InstantiationException ie)%0A        %7B%0A            throw new RuntimeException(%22Cannot create %22 + c.getName(), ie);%0A        %7D%0A        catch (ClassNotFoundException cnfe)%0A        %7B%0A            throw new RuntimeException(%22Cannot create %22 + targetClass, cnfe);%0A        %7D%0A    %7D%0A%0A    public Constructor getConstructor(Class c) %7B return null; %7D%0A%0A%7D%0A

Add Bug3479080