Community
Participate
Working Groups
Once bug 236385 is fixed, the new option needs to be exposed in the UI.
Maybe also add a quick fix to insert 'throw' (for Throwables) or 'return' (if the type is compatible with the return type of the enclosing method).
Created attachment 155984 [details] Proposed fix This only adds the corresponding option in the preference page under the right category.
Created attachment 156003 [details] Same patch with copyright updates
Created attachment 156037 [details] Patch 3 Adds quick fixes and adjusts layout for bug 236385 comment 39.
Released Patch 3 to HEAD.
Verified on I20100125-0800 In the following snipped a warning is shown on both object allocations. Quick fix for the exception object includes 'Throw'. This much works as expected. public void foo() { if (bar()) new IllegalArgumentException("You must not bar!"); new String("Unused allocation"); } (In reply to comment #1) > Maybe also add a quick fix to insert 'throw' (for Throwables) or 'return' (if > the type is compatible with the return type of the enclosing method). The quick fix also includes return for both objects, even though the return type is not compatible. Is this expected?
Verified in I20100125-1800. >The quick fix also includes return for both objects, even though the return >type is not compatible. Is this expected? Filed bug 300778 to track this: the quick fix should either not be offered or it should also replace 'void' with the correct return type.