This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I create an ExpressionTree for 1 & (2 & (3 & 4)), i.e. (make is of type TreeMaker) BinaryTree b = make.Binary(Kind.AND, make.Literal(Integer.valueOf(1)), make.Binary(Kind.AND, make.Literal(Integer.valueOf(2)), make.Binary(Kind.AND, make.Literal(Integer.valueOf(3)), make.Literal(Integer.valueOf(4))))); and insert it into the source code, it is inserted WITHOUT parentheses, i.e. 1 & 2 & 3 & 4 is inserted.
Currently, the clients of TreeMaker are expected to create tree structure matching exactly the tree that would be created by the parser for the desired output, including required make.Parenthesis. I agree that the behavior is not very intuitive in the above case. It might be possible to improve the situation - this should be investigated. Does not qualify as a defect IMO.
Overtake.