| Summary: | isNegated() returning wrong results | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Stephen DiMilla <stephen.dimilla> | ||||||
| Component: | Eclipselink | Assignee: | Tom Ware <tom.ware> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | blocker | ||||||||
| Priority: | P3 | CC: | lance.andersen, stephen.dimilla, tom.ware | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | Macintosh | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Updating target milestone. This failure is also seen with CriteriaBuilder.In.isNegated() Created attachment 226645 [details]
proposed fix
Created attachment 226660 [details]
updated patch
Fix checked in - store isNegated in a variable and return that variable from the isNegatedCall Reviewed by Gordon Yorke Added test to JPA 2.1 Query test suite Tested with JPA LRG The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: eclipselink-2.3.0.v20110604-r9504 Execute the following client code: CriteriaBuilder qbuilder = em.getCriteriaBuilder(); System.out.println("Testing default"); Boolean result = qbuilder.equal(qbuilder.literal("1"), "1").isNegated(); if (!result) { System.out.println("Received expected result:" + result); } else { System.out.println("Expected:false , actual:" + result); } System.out.println("Testing when Predicate.not is present"); result = qbuilder.equal(qbuilder.literal("1"), "1").not().isNegated(); if (result) { System.out.println("Received expected result:" + result); } else { System.out.println("Expected:true, actual:" + result); } System.out.println("Testing when CriteriaBuilder.not is present"); result = qbuilder.not(qbuilder.equal(qbuilder.literal("1"), "1")).isNegated(); if (result) { System.out.println("Received expected result:" + result); } else { System.out.println("Expected:true, actual:" + result); } The output is: Testing default Received expected result:false Testing when Predicate.not is present Expected:true, actual:false Testing when CriteriaBuilder.not is present Expected:true, actual:false The second and third scenarios fail to return the correct result Reproducible: Always