Summary: | [null]Quickfix extract to checked local variable on Potential null pointer access | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Holger Klene <h.klene> | ||||
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
Status: | REOPENED --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | stephan.herrmann | ||||
Version: | 4.4 | Keywords: | helpwanted | ||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | stalebug | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 427423 | ||||||
Attachments: |
|
Description
Holger Klene
2014-07-24 05:16:12 EDT
Created attachment 245329 [details]
Demo-sourcecode
(In reply to Holger Klene from comment #0) > Can you please try to: > A) Make it handle generics. The problem is specific to the use of a type variable as a type argument. List<String>, e.g., is handled correctly. From a quick comparison it looks like org.eclipse.jdt.internal.ui.text.correction.proposals.ExtractToNullCheckedLocalProposal.newType(ITypeBinding, AST, ImportRewrite) is doing a lot of stuff (incompletely it seems) that is better delegated to ImportRewrite.addImport(). > B) Check the immediately preceding statement, if it already is a null check > (don't offer "extract to checked local variable" but instead fall back to > "extract to local variable"). Not sure how much effort this would cost. > C) Also apply Quickfix to 200 error Should be done as part of bug 427423. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. At least issue (A) should be addressed. . This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |