Community
Participate
Working Groups
Curly braces will no longer make a variable not be null. Only an initializer or assignment can do that. The set-values block is only a set-values block; it no longer creates an instance of a type. Each of the following variations creates an instance, and they are equally efficient:: b Button {text ="abc"}; b Button = new Button {text = "abc"}; b Button? = new Button{text = "abc"}; b Button {text = "abc"} = new Button{text="xyz"}; In the last example, only fields can be in the second block; annotations cannot. Any assignments to fields in the first block are ignored. You cannot assign a value to a nullable variable that was not initialized. The following examples are not valid: b Button? {text = "abc"}; // is an error because of the set-values block (setting a field of a null variable). b Button? {text = "abc"} = new Button {text = "xyz"}; // is also an error because of the leftmost set-values block. The errors will be caught at compile time.
Changing the target milestone since we're in I-15 now. This is probably done, but the testcase is currently blocked by bug 358102.
this looks done to me
This is done.
Closing all JavaGen enhancements that are in the Resolved state.