Project: JDT
Bug 197722 5 failures in Eclipse Automated tests in org.eclipse.ltk.core.refactoring when using IBM Java 6.0
Reported: 2007-07-24 18:08:22 | Status: verified fixed

Build ID: I20070625-1500 Steps To Reproduce: 1. Set up and run Eclipse with IBM Java 6.0 and its libraries to run the Eclipse Automated Test suite. 2. Observe 5 failures in org.eclipse.ltk.core.refactoring tests.history, particularly testWriteDescriptor0..4. More information: There are also 8 failures in org.eclipse.jdt.ui.tests that appear to be caused by the same problem. I have tracked these errors down to an issue in with the method RefactoringHistorySerializationTests where a descriptor is converted to an XML stream, with the output property "indent" set to "yes". The code in compareWrittenDescriptor assumes that the javax transform method will produce a fixed XML ouput, being identical to the string that is passed into the routine for comparison. However, the "indent" property is more of a suggestion to the transform method. According to the W3C xslt specification, which defines this property: "If the indent attribute has the value yes, then the xml output method may output whitespace in addition to the whitespace in the result tree (possibly based on whitespace stripped from either the source document or the stylesheet) in order to indent the result nicely;..." As a result of having set the indent attribute to yes, the javax library in IBM Java 6.0 inserts whitespace (newlines in this case) slightly differently than earlier JRE's. In order that the comparison be made reliable, I'd suggest setting the indent property to "no", and then removing the newlines from the expected result strings. The indent property is set in: org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryManager.class

Files changed in fix:
org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/RefactoringHistorySerializationTests.java org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/RefactoringSessionTransformer.java org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/history/RefactoringHistoryManager.java