Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 437999 - [1.8][null] Various issues with inference of allocation expressions
Summary: [1.8][null] Various issues with inference of allocation expressions
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-24 04:14 EDT by Clovis Seragiotto CLA
Modified: 2018-11-19 19:33 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clovis Seragiotto CLA 2014-06-24 04:14:11 EDT
With annotation-based null analysis enabled, the following program cannot be compiled; the error is:
Missing code implementation in the compiler	(line 9)

import org.eclipse.jdt.annotation.NonNullByDefault;

@NonNullByDefault({})
class MyOptional<T> {
    MyOptional(@org.eclipse.jdt.annotation.Nullable T value) { System.out.println(value); }

    @NonNullByDefault
    static void test(Double d) {
        MyOptional<Double> o2 = new MyOptional<Double>(d);
    }
}
Comment 1 Stephan Herrmann CLA 2014-06-28 08:59:03 EDT
Thanks for the report. Playing with the example I see several problems in how we infer types for allocation expressions. Some are related to null type annotations, some are general problems. I'll try to achieve better test coverage via this bug.
Comment 2 Stephan Herrmann CLA 2014-07-22 06:15:01 EDT
Removing dependency to unblock the other bug.
Comment 3 Stephan Herrmann CLA 2014-07-26 05:28:54 EDT
Test for bug 440462 has a FIXME to be addressed via this bug.
Comment 4 Stephan Herrmann CLA 2015-06-12 09:28:28 EDT
I do have a local git branch with tests and experiments in this area. I should ASAP skim these wip changes to figure out where we stand.
Comment 5 Stephan Herrmann CLA 2016-04-24 17:06:54 EDT
Bulk move: too late for 4.6 M7.

Very likely has to be moved out of 4.6 entirely.
Comment 6 Stephan Herrmann CLA 2017-05-16 12:05:02 EDT
Ran out of time for 4.7. Bulk move to 4.8.
Comment 7 Manoj N Palat CLA 2018-05-16 12:56:24 EDT
bulk move out of 4.8
Comment 8 Eclipse Genie CLA 2018-08-26 12:20:30 EDT
New Gerrit change created: https://git.eclipse.org/r/128086
Comment 9 Stephan Herrmann CLA 2018-08-26 12:28:14 EDT
(In reply to Eclipse Genie from comment #8)
> New Gerrit change created: https://git.eclipse.org/r/128086

I retrieved the local branch mentioned above from an old machine and only draftily resolved merge conflicts. To take stock during 4.10.
Comment 10 Stephan Herrmann CLA 2018-11-19 19:33:05 EST
I thoroughly dropped the ball here.

comment 0 is no longer a problems since 4.4.1

I have no clue what problems I was seeing in comment 1.

The fixme mentioned in comment 3 is *not* resolved by https://git.eclipse.org/r/128086

Marking status vs. the original problem comment 0