Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355253

Summary: warnings regarding synthetic variables _OT$unlowerd$123
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

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