poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r902563 - in /poi/trunk/src: documentation/content/xdocs/status.xml ooxml/java/org/apache/poi/util/OOXMLLite.java
Date Sun, 24 Jan 2010 13:11:47 GMT
Author: yegor
Date: Sun Jan 24 13:11:46 2010
New Revision: 902563

URL: http://svn.apache.org/viewvc?rev=902563&view=rev
Log:
always copy all declared inner classes and interfaces when generating poi-ooxml-schemas, see
Bugzilla 48572

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

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=902563&r1=902562&r2=902563&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Sun Jan 24 13:11:46 2010
@@ -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>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java?rev=902563&r1=902562&r2=902563&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java Sun Jan 24 13:11:46 2010
@@ -109,23 +109,17 @@
             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);
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message