harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r811367 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
Date Fri, 04 Sep 2009 12:35:07 GMT
Author: tellison
Date: Fri Sep  4 12:35:07 2009
New Revision: 811367

URL: http://svn.apache.org/viewvc?rev=811367&view=rev
Log:
No need to call native method for each check of platform endianness.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java?rev=811367&r1=811366&r2=811367&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
Fri Sep  4 12:35:07 2009
@@ -69,6 +69,15 @@
 		return singleton;
 	}
 
+    /*
+     * Native method to determine whether the underlying platform is little
+     * endian.
+     * 
+     * @return <code>true</code> if the platform is little endian or
+     * <code>false</code> if it is big endian.
+     */
+    private static native boolean isLittleEndianImpl();
+
 	/**
 	 * This class is not designed to be publicly instantiated.
 	 * 
@@ -78,16 +87,14 @@
 		super();
 	}
 
-	/**
-	 * Answers whether the byte order of this machine is little endian or not..
-	 * 
-	 * @return <code>false</code> for Big Endian, and
-	 *         <code>true</code. for Little Endian.
-	 */
-	public static native boolean isLittleEndianImpl();
-
+    /**
+     * Answers whether the byte order of this machine is little endian or not.
+     * 
+     * @return <code>false</code> for Big Endian, and
+     *         <code>true</code> for Little Endian.
+     */
 	public boolean isLittleEndian() {
-		return isLittleEndianImpl();
+		return NATIVE_ORDER == Endianness.LITTLE_ENDIAN;
 	}
 
 	/**



Mime
View raw message