Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355253 - warnings regarding synthetic variables _OT$unlowerd$123
Summary: warnings regarding synthetic variables _OT$unlowerd$123
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-19 14:53 EDT by Stephan Herrmann CLA
Modified: 2012-09-20 17:03 EDT (History)
0 users

See Also:


Attachments
test & fix (6.35 KB, patch)
2011-08-27 09:13 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-08-19 14:53:57 EDT
In plugin org.eclipse.objectteams.otdt.jdt.ui several warnings are
raised against those synthetic variables that are internally used to
translate safe lowering:

Description	Resource	Path	Location	Type
Null comparison always yields false: The variable _OT$unlowered$2909 cannot be null at this location	DOMAdaptor.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext	line 79	Java Problem
Null comparison always yields false: The variable _OT$unlowered$2991 cannot be null at this location	DOMAdaptor.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext	line 81	Java Problem
Null comparison always yields false: The variable _OT$unlowered$7535 cannot be null at this location	CreateMethodMappingCompletionProposal.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor	line 178	Java Problem
Null comparison always yields false: The variable _OT$unlowered$9054 cannot be null at this location	OTQuickFixes.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist	line 192	Java Problem
Null comparison always yields false: The variable _OT$unlowered$23347 cannot be null at this location	CompletionAdaptor.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist	line 507	Java Problem
Null comparison always yields false: The variable _OT$unlowered$23706 cannot be null at this location	CompletionAdaptor.java	/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist	line 511	Java Problem

We might either: suppress this warning or avoiding generating that 
unnecessary null check.
Comment 1 Stephan Herrmann CLA 2011-08-27 09:13:22 EDT
Created attachment 202266 [details]
test & fix

This patch fixes the problem in two steps:

- avoid null checks for syntactically non-null values (this, new)

- mark check as generated and don't analyse null-comparison for these.
Comment 2 Stephan Herrmann CLA 2011-08-27 09:14:50 EDT
Patch has been released for 2.1 M2 (r1976/77)
Comment 3 Stephan Herrmann CLA 2012-09-20 17:03:02 EDT
Verified using build 2.2.1.201209182002