xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r164687 - in /xmlbeans/trunk/src: common/org/apache/xmlbeans/impl/common/JarHelper.java store/org/apache/xmlbeans/impl/store/Saver.java typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
Date Mon, 25 Apr 2005 23:32:21 GMT
Author: radup
Date: Mon Apr 25 16:32:19 2005
New Revision: 164687

URL: http://svn.apache.org/viewcvs?rev=164687&view=rev
Log:
Address JIRA issues XMLBEANS-102, XMLBEANS-135 and XMLBEANS-146.


Modified:
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/JarHelper.java
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/JarHelper.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/JarHelper.java?rev=164687&r1=164686&r2=164687&view=diff
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/JarHelper.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/JarHelper.java Mon Apr 25 16:32:19
2005
@@ -40,7 +40,7 @@
   private byte[] mBuffer = new byte[BUFFER_SIZE];
   private int mByteCount = 0;
   private boolean mVerbose = false;
-  private String destJarName = "";
+  private String mDestJarName = "";
 
   // ========================================================================
   // Constructor
@@ -62,10 +62,7 @@
     if (dirOrFile2Jar == null || destJar == null)
         throw new IllegalArgumentException();
 
-    destJarName = destJar.getPath().replace(File.separatorChar, SEP);
-    if (destJarName.startsWith("./"))
-      destJarName = destJarName.substring(2);
-
+    mDestJarName = destJar.getCanonicalPath();
     FileOutputStream fout = new FileOutputStream(destJar);
     JarOutputStream jout = new JarOutputStream(fout);
     //jout.setLevel(0);
@@ -150,19 +147,13 @@
         jarDir(f,jos,subPath);
       }
     } else {
-      String filePath = dirOrFile2jar.getPath();
-      if (filePath.startsWith("/"))
-          filePath = filePath.substring(1);
-      else if (filePath.startsWith("./"))
-          filePath = filePath.substring(2);
-
-      if (filePath.equals("") || filePath.equals(destJarName))
+      if (dirOrFile2jar.getCanonicalPath().equals(mDestJarName))
       {
-        if (mVerbose) System.out.println("skipping " + filePath);
+        if (mVerbose) System.out.println("skipping " + dirOrFile2jar.getPath());
         return;
       }
 
-      if (mVerbose) System.out.println("adding " + filePath);
+      if (mVerbose) System.out.println("adding " + dirOrFile2jar.getPath());
       FileInputStream fis = new FileInputStream(dirOrFile2jar);
       try {
         JarEntry entry = new JarEntry(path+dirOrFile2jar.getName());

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=164687&r1=164686&r2=164687&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Mon Apr 25 16:32:19
2005
@@ -1239,7 +1239,7 @@
                     char ch = _buf[ i ];
 
                     if (ch == '>' && secondToLastWasBracket && lastWasBracket)
-                        i = replace( i, ">" );
+                        i = replace( i, "]]>><![CDATA[" );
                     else if (isBadChar( ch ))
                         i = replace( i, "?" );
                     else
@@ -1256,14 +1256,19 @@
             }
             else
             {
+                char ch = 0, ch_1 = 0, ch_2;
                 for ( int cch = _lastEmitCch ; cch > 0 ; cch-- )
                 {
-                    char ch = _buf[ i ];
+                    ch_2 = ch_1;
+                    ch_1 = ch;
+                    ch = _buf[ i ];
 
                     if (ch == '<')
                         i = replace( i, "&lt;" );
                     else if (ch == '&')
                         i = replace( i, "&amp;" );
+                    else if (ch == '>' && ch_1 == ']' && ch_2 == ']')
+                        i = replace( i, "&gt;" );
                     else if (isBadChar( ch ))
                         i = replace( i, "?" );
                     else

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java?rev=164687&r1=164686&r2=164687&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java Mon Apr
25 16:32:19 2005
@@ -1207,6 +1207,8 @@
 
     private void computeFlatUnionModel()
     {
+        if (getSimpleVariety() != SchemaType.UNION)
+            throw new IllegalStateException("Operation is only supported on union types");
         Set constituentMemberTypes = new LinkedHashSet();
         Set allSubTypes = new LinkedHashSet();
         SchemaType commonBaseType = null;



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


Mime
View raw message