This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1) Select the following text: -------------- if (postArray.equals("byte")) return "B"; if (postArray.equals("char")) return "C"; if (postArray.equals("double")) return "D"; if (postArray.equals("float")) return "F"; if (postArray.equals("int")) return "I"; if (postArray.equals("long")) return "J"; if (postArray.equals("short")) return "S"; if (postArray.equals("boolean")) return "Z"; if (postArray.equals("void")) return "V"; ----------- 2) Select "Introduce Method" 3) Netbeans complains "Different return values" when in fact all expressions are returning a String. The real source of the error is that the method is missing a return value if all conditionals evaluate to false. Adding a non-condiitonal "return" statement to the end of the block solves the problem. I am expecting Netbeans to give a clearer error message such as: "Missing return statement"