Community
Participate
Working Groups
When concatenating a string with a possibly null variable using the `+` operator, Eclipse 3.2M5a gives a warning if _Null reference_ is set in Compiler->Errors/Warnings. Actually, the Java compiler allows nulls in this context and deliberately inserts the string "null". See the Java Language Specification, ยง15.18.1 [http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#39990]. While some might argue that a warning here is still meritable, I'd suggest a special case in the JLS wins the argument. I would think a checkbox to allow personal preference reasonable; absent a toggle there should be no warning. The JLS has this special case for a reason. For example, lots of code traps nulls and logs and/or throws an exception indicating the problem: if (folderName == null || !FOLDER_PATTERN.matches(folderName)) throw new BadFolderException("Folder " + folderName + " is invalid"); The whole purpose of the JLS's explicit null handling here is to avoid silly code like this: folderName == null ? "null" : folderName
This has been fixed with M6. *** This bug has been marked as a duplicate of 127919 ***