Log Message
Deprecate JVM.is14() and JVM.is15().
Modified Paths
Diff
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/core/JVM.java (2002 => 2003)
--- trunk/xstream/src/java/com/thoughtworks/xstream/core/JVM.java 2013-01-14 18:36:05 UTC (rev 2002)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/core/JVM.java 2013-01-15 22:46:08 UTC (rev 2003)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -46,9 +46,9 @@
private static final String vendor = System.getProperty("java.vm.vendor");
private static final float majorJavaVersion = getMajorJavaVersion();
- private static final boolean reverseFieldOrder = isHarmony() || (isIBM() && !is15());
+ private static final boolean reverseFieldOrder = isIBM() && !is15();
- static final float DEFAULT_JAVA_VERSION = 1.3f;
+ private static final float DEFAULT_JAVA_VERSION = 1.4f;
static {
Comparator comparator = new Comparator() {
@@ -99,10 +99,16 @@
}
}
+ /**
+ * @deprecated As of upcoming, minimal JDK version is 1.4 already
+ */
public static boolean is14() {
return majorJavaVersion >= 1.4f;
}
+ /**
+ * @deprecated As of upcoming, minimal JDK version will be 1.5 for next major release
+ */
public static boolean is15() {
return majorJavaVersion >= 1.5f;
}
@@ -153,10 +159,6 @@
return vendor.indexOf("FreeBSD Foundation") != -1;
}
- private static boolean isHarmony() {
- return vendor.indexOf("Apache Software Foundation") != -1;
- }
-
/**
* @since 1.4
*/
@@ -248,8 +250,6 @@
String className = null;
if (canUseSun14ReflectionProvider()) {
className = "com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider";
- } else if (canUseHarmonyReflectionProvider()) {
- className = "com.thoughtworks.xstream.converters.reflection.HarmonyReflectionProvider";
}
if (className != null) {
Class cls = loadClass(className);
@@ -287,10 +287,6 @@
&& loadClass("sun.misc.Unsafe") != null;
}
- private boolean canUseHarmonyReflectionProvider() {
- return isHarmony();
- }
-
public static boolean reverseFieldDefinition() {
return reverseFieldOrder;
}
@@ -371,13 +367,13 @@
System.out.println("java.specification.version: " + System.getProperty("java.specification.version"));
System.out.println("java.vm.vendor: " + vendor);
System.out.println("Version: " + majorJavaVersion);
- System.out.println("XStream support for enhanced Mode: " + (jvm.canUseSun14ReflectionProvider() || jvm.canUseHarmonyReflectionProvider()));
+ System.out.println("XStream support for enhanced Mode: " + jvm.canUseSun14ReflectionProvider());
System.out.println("Supports AWT: " + jvm.supportsAWT());
System.out.println("Supports Swing: " + jvm.supportsSwing());
System.out.println("Supports SQL: " + jvm.supportsSQL());
System.out.println("Optimized TreeSet.addAll: " + hasOptimizedTreeSetAddAll());
System.out.println("Optimized TreeMap.putAll: " + hasOptimizedTreeMapPutAll());
System.out.println("Can parse UTC date format: " + canParseUTCDateFormat());
- System.out.println("Reverse field order detected (may have failed): " + reverse);
+ System.out.println("Reverse field order detected (only if JVM class itself has been compiled): " + reverse);
}
}
To unsubscribe from this list please visit:
