Summary: | [compiler][null] detect assigning null to nonnull argument | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | amj87.iitr, srikanth_sankaran | ||||
Version: | 3.8 | ||||||
Target Milestone: | 3.8 M5 | ||||||
Hardware: | Other | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Stephan Herrmann
2011-12-20 10:52:54 EST
Created attachment 208637 [details] tests & fix (In reply to comment #0) > This test reveals an obvious omission inside > AbstractMethodDeclaration.addParameternonNullAnnotation > which can be easily fixed: update the tagBits of argument.binding. The patch does this at the call site in MethodBinding.fillInDefaultNonNullness > I should also add a test for the inverse: > arg is nonnull from default, passed to a method requiring nonnull. > Expecting this to fail currently, too. Test has been added, my prediction was wrong, though: this case was already handled via AbstractMethodDeclaration.analyseArguments() (which uses MethodBinding.parameterNonNullness instead of tagBits). Aggressive tests are currently running. (In reply to comment #1) > > I should also add a test for the inverse: > > arg is nonnull from default, passed to a method requiring nonnull. > > Expecting this to fail currently, too. > > Test has been added, my prediction was wrong, though: this case was > already handled via AbstractMethodDeclaration.analyseArguments() > (which uses MethodBinding.parameterNonNullness instead of tagBits). Yes, we'd already tested this particular case. Released for 3.8 M5 via commit 3a3faf3d0aa82cf2ed2b8375e651ef0b429b1314 Verified for 3.8 M5 using build id: I20120122-2000 |