Details
-
Type: New Feature
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1.2
-
Component/s: None
-
Labels:None
Description
I don't know whether enhanced mode works under Sun JDK 1.5. If it does, great - job done. Otherwise I'd like to find an alternative.
-
- CollectionsTest.html
- 11 kB
- Grégory Joseph (old account)
-
- TEST-com.thoughtworks.acceptance.CollectionsTest.xml
- 10 kB
- Grégory Joseph (old account)
Activity
If the unit tests passed, I think that would prove it's good.
With the source and target attributes of the compiling targets set to 1.5, it yields two warnings on compilation:
xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializationMethodInvoker.java:33: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac] cast to java.lang.Object for a varargs call
[javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning
[javac] return readResolveMethod.invoke(result, null);
[javac] ^
[javac] xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializationMethodInvoker.java:52: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac] cast to java.lang.Object for a varargs call
[javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning
[javac] return writeReplaceMethod.invoke(object, null);
[javac] ^
[javac] Note: * uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 warnings
And a compilation error:
xstream/src/test/com/thoughtworks/acceptance/objects/ColorEnum.java:3: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
[javac] (try -source 1.4 or lower to use 'enum' as an identifier)
[javac] import org.apache.commons.lang.enum.Enum;
[javac] ^
[javac] 1 error
With the source and target attributes set to 1.4, the compile error turns into a warning, and the CollectionsTest fail.
[junit] Testcase: testSyncronizedWrapper(com.thoughtworks.acceptance.CollectionsTest): FAILED
[junit] expected:<...>
[junit] <list class="linked-list">
[junit] <string>hi</string>
[junit] </list>
[junit] <c class="linked-list" reference="../list"/>
[junit] <mutex class="java.util.Collections-SynchronizedList" reference=".."/...> but was:<... serialization="custom">
[junit] <java.util.Collections-SynchronizedCollection>
[junit] <default>
[junit] <c class="linked-list">
[junit] <string>hi</string>
[junit] </c>
[junit] <mutex class="java.util.Collections-SynchronizedList" reference="../../.."/>
[junit] </default>
[junit] </java.util.Collections-SynchronizedCollection>
[junit] <java.util.Collections-SynchronizedList>
[junit] <default>
[junit] <list class="linked-list" reference="../../../java.util.Collections-SynchronizedCollection/default/c"/>
[junit] </default>
[junit] </java.util.Collections-SynchronizedList...>
[junit] junit.framework.ComparisonFailure: expected:<...>
[junit] <list class="linked-list">
[junit] <string>hi</string>
[junit] </list>
[junit] <c class="linked-list" reference="../list"/>
[junit] <mutex class="java.util.Collections-SynchronizedList" reference=".."/...> but was:<... serialization="custom">
[junit] <java.util.Collections-SynchronizedCollection>
[junit] <default>
[junit] <c class="linked-list">
[junit] <string>hi</string>
[junit] </c>
[junit] <mutex class="java.util.Collections-SynchronizedList" reference="../../.."/>
[junit] </default>
[junit] </java.util.Collections-SynchronizedCollection>
[junit] <java.util.Collections-SynchronizedList>
[junit] <default>
[junit] <list class="linked-list" reference="../../../java.util.Collections-SynchronizedCollection/default/c"/>
[junit] </default>
[junit] </java.util.Collections-SynchronizedList...>
[junit] at com.thoughtworks.acceptance.AbstractAcceptanceTest.assertBothWays(Unknown Source)
[junit] at com.thoughtworks.acceptance.CollectionsTest.testSyncronizedWrapper(Unknown Source)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
See attachments for more info.
Need more info?
Starting with 1.1.2 XStream was running the unit tests with JDK 1.5.
Joe,
Would building xstream succesfully with a jdk1.5 be a sufficient positive answer to this?