]> source.dussan.org Git - poi.git/commitdiff
always copy all declared inner classes and interfaces when generating poi-ooxml-schem...
authorYegor Kozlov <yegor@apache.org>
Sun, 24 Jan 2010 13:11:46 +0000 (13:11 +0000)
committerYegor Kozlov <yegor@apache.org>
Sun, 24 Jan 2010 13:11:46 +0000 (13:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@902563 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/java/org/apache/poi/util/OOXMLLite.java

index a0462404a2b173537b7143bef60d43ef2c5da5ca..cea82874342653c42909ec0c572114e8ed91bb86 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.7-SNAPSHOT" date="2010-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">48572 - always copy all declared inner classes and interfaces when generating poi-ooxml-schemas</action>
            <action dev="POI-DEVELOPERS" type="add">Low Level record support for the ExtRst (phonetic text) part of Unicode Strings. No usermodel access to it as yet though.</action>
            <action dev="POI-DEVELOPERS" type="fix">record.UnicodeString has moved to record.common.UnicodeString, to live with the other record-part classes, as it isn't a full record.</action>
            <action dev="POI-DEVELOPERS" type="add">Avoid creating temporary files when opening OPC packages from input stream</action>
index e533373ba3785d08342af4bb17e20a6e5005c41c..b0e7b26dc45be108f64f120c46d8a06874e87209 100755 (executable)
@@ -109,23 +109,17 @@ public final class OOXMLLite {
             String className = cls.getName();
             String classRef = className.replace('.', '/') + ".class";
             File destFile = new File(_destDest, classRef);
-            //System.out.println(classRef + "  -->  " + destFile);
             copyFile(cls.getResourceAsStream('/' + classRef), destFile);
 
             if(cls.isInterface()){
-                //always copy Factory that accompanies every ooxml schema object
-                String factoryClass = className + "$Factory";
-                if(!classes.containsKey(factoryClass)){
-                    try {
-                        Class fc = Class.forName(factoryClass);
-                        className = fc.getName();
-                        classRef = className.replace('.', '/') + ".class";
-                        destFile = new File(_destDest, classRef);
-                        //System.out.println(classRef + "  -->  " + destFile);
-                        copyFile(fc.getResourceAsStream('/' + classRef), destFile);
-                    } catch(ClassNotFoundException e) {
-                        e.printStackTrace();
-                    }
+                /**
+                 * Copy classes and interfaces declared as members of this class
+                 */
+                for(Class fc : cls.getDeclaredClasses()){
+                    className = fc.getName();
+                    classRef = className.replace('.', '/') + ".class";
+                    destFile = new File(_destDest, classRef);
+                    copyFile(fc.getResourceAsStream('/' + classRef), destFile);
                 }
             }
         }