package test; import java.net.MalformedURLException; import java.net.URL; public class Main { public static void main(String[] args) { test1(args); test2(args); test3(args); } private static void test1(String[] args) { URL[] urls = null; try { urls = new URL[args.length]; for (int i = 0; i < args.length; i++) urls[i] = new URL("http", "", -1, args[i]); } catch (MalformedURLException mfex) { urls = null; // Wrong warning here: 'The variable urls can only be null at this location'. } } private static void test2(String[] args) { assert args != null; if (args != null) { // Wrong warning here: 'The variable args cannot be null at this location'. // do something } } private static void test3(String[] args) { while (true) { Object a = null; try { a = new Object(); } catch (Exception e) { } finally { if (a != null) a = null; // Wrong warning here: 'Null comparison always yields false: The variable a cannot be null at this location'. } } } }