You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2009/08/11 10:43:43 UTC

svn commit: r803031 - /felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java

Author: clement
Date: Tue Aug 11 08:43:43 2009
New Revision: 803031

URL: http://svn.apache.org/viewvc?rev=803031&view=rev
Log:
Fix issue  FELIX-1411
On windows system the directory manipulation failed because the collected class files contains \ characters and the internal list contains / characters as path separator.
This is fixed by replacing \ by / during the collection.

The fix was tested on Windows and Mac OS.

Modified:
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java?rev=803031&r1=803030&r2=803031&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java Tue Aug 11 08:43:43 2009
@@ -227,7 +227,7 @@
 
         // Start the manipulation
         manipulateJarFile(out);
-
+        
         // Check that all declared components are manipulated
         for (int i = 0; i < m_components.size(); i++) {
             ComponentInfo ci = (ComponentInfo) m_components.get(i);
@@ -457,7 +457,6 @@
      * Manipulate classes of the input Jar.
      */
     private void manipulateComponents() {
-        //Enumeration entries = inputJar.entries();
         Enumeration entries = getClassFiles();
 
         while (entries.hasMoreElements()) {
@@ -483,7 +482,7 @@
                     if (ci.m_classname.equals(curName)) {
                         byte[] outClazz = manipulateComponent(in, ci);
                         m_classes.put(ci.m_classname, outClazz);
-
+                        
                         // Manipulate inner classes ?
                         if (!ci.m_inners.isEmpty()) {
                             for (int k = 0; k < ci.m_inners.size(); k++) {
@@ -605,7 +604,8 @@
      */
     private String computeRelativePath(String absolutePath) {
         String root = m_dir.getAbsolutePath();
-        return absolutePath.substring(root.length() + 1);
+        String path = absolutePath.substring(root.length() + 1);
+        return path.replace("\\", "/"); // To support Windows systems, the \ are replaced by /
     }
 
     /**