harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r818803 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/java/io/File.java native/luni/shared/file.c native/luni/unix/helpers.c native/luni/unix/helpers.h native/luni/windows/helpers.c native/luni/windows/helpers.h
Date Fri, 25 Sep 2009 10:05:39 GMT
Author: tellison
Date: Fri Sep 25 10:05:39 2009
New Revision: 818803

URL: http://svn.apache.org/viewvc?rev=818803&view=rev
Log:
Part of HARMONY-6341 ([classlib][luni] - implement File.isAbsolute/getAbsolutePath() in java
code)
Apply patch to remove unused properPathImpl() native, and associated getPlatformPath() native
code

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.h

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Fri Sep 25
10:05:39 2009
@@ -1366,8 +1366,6 @@
         return properPath = Util.getUTF8Bytes(result);
     }
 
-    private static native byte[] properPathImpl(byte[] path);
-
     /**
      * Renames this file to the name represented by the {@code dest} file. This
      * works for both normal files and directories.

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c Fri Sep
25 10:05:39 2009
@@ -457,12 +457,6 @@
   return;
 }
 
-JNIEXPORT jbyteArray JNICALL
-Java_java_io_File_properPathImpl (JNIEnv * env, jobject recv, jbyteArray path)
-{
-  return getPlatformPath (env, path);
-}
-
 JNIEXPORT jboolean JNICALL
 Java_java_io_File_isReadOnlyImpl (JNIEnv * env, jobject recv, jbyteArray path)
 {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c Fri Sep
25 10:05:39 2009
@@ -120,12 +120,6 @@
 
 }
 
-jbyteArray
-getPlatformPath (JNIEnv * env, jbyteArray path)
-{
-  return NULL;
-}
-
 void
 setPlatformBindOptions (JNIEnv * env, hysocket_t socketP)
 {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.h?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.h Fri Sep
25 10:05:39 2009
@@ -19,7 +19,6 @@
 #define helpers_h
 #include "vmi.h"
 int platformReadLink (char *link);
-jbyteArray getPlatformPath (JNIEnv * env, jbyteArray path);
 void setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP);
 I_32 getPlatformRoots (char *rootStrings);
 char *getCommports (JNIEnv * env);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c Fri
Sep 25 10:05:39 2009
@@ -35,7 +35,6 @@
 #include "hysock.h"
 
 int platformReadLink (char *link);
-jbyteArray getPlatformPath (JNIEnv * env, jbyteArray path);
 void setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP);
 jint getPlatformDatagramNominalSize (JNIEnv * env, hysocket_t socketP);
 I_32 getPlatformRoots (char *rootStrings);
@@ -196,54 +195,6 @@
   return SetEndOfFile ((HANDLE) descriptor);
 }
 
-jbyteArray
-getPlatformPath (JNIEnv * env, jbyteArray path)
-{
-  char buffer[256];
-  jbyteArray answer = NULL;
-  jsize length = (*env)->GetArrayLength (env, path);
-  jbyte *lpath = (*env)->GetByteArrayElements (env, path, 0);
-
-  if (lpath != NULL)
-    {
-      if (length >= 2 && lpath[1] == ':')
-        {
-          char next = lpath[2];
-          int drive = tolower (lpath[0]) - 'a' + 1;
-          if ((next == 0 || (lpath[2] != '/' && next != '\\')) && drive >=
1
-            && drive <= 26)
-            {
-              int buflen = 2, needSlash;
-              if (_getdcwd (drive, buffer, sizeof (buffer)) != NULL)
-                {
-                  buflen = strlen (buffer);
-                  if (buffer[buflen - 1] == '\\')
-                    buflen--;
-                }
-              needSlash = length > 2 || buflen < 3;
-              answer =
-                (*env)->NewByteArray (env,
-                buflen + length - (needSlash ? 1 : 2));
-              if (answer != NULL)
-                {
-                  /* Copy drive and colon */
-                  (*env)->SetByteArrayRegion (env, answer, 0, 2, lpath);
-                  if (buflen > 2)
-                    (*env)->SetByteArrayRegion (env, answer, 2, buflen - 2,
-                    buffer + 2);
-                  if (needSlash)
-                    (*env)->SetByteArrayRegion (env, answer, buflen, 1, "\\");
-                  if (length > 2)
-                    (*env)->SetByteArrayRegion (env, answer, buflen + 1,
-                    length - 2, lpath + 2);
-                }
-            }
-        }
-      (*env)->ReleaseByteArrayElements (env, path, lpath, JNI_ABORT);
-    }
-  return answer;
-}
-
 UDATA
 platformFindfirst (char *path, char *resultbuf)
 {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.h?rev=818803&r1=818802&r2=818803&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.h Fri
Sep 25 10:05:39 2009
@@ -18,7 +18,6 @@
 #if !defined(helpers_h)
 #define helpers_h
 int platformReadLink (char *link);
-jbyteArray getPlatformPath (JNIEnv * env, jbyteArray path);
 void setDefaultServerSocketOptions (JNIEnv * env, hysocket_t socketP);
 jint getPlatformDatagramNominalSize (JNIEnv * env, hysocket_t socketP);
 I_32 getPlatformRoots (char *rootStrings);



Mime
View raw message