cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1060350 - in /cxf/branches/2.3.x-fixes: ./ tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/ tools/corba/src/test/resources/idlpreprocessor/
Date Tue, 18 Jan 2011 12:37:50 GMT
Author: ffang
Date: Tue Jan 18 12:37:50 2011
New Revision: 1060350

URL: http://svn.apache.org/viewvc?rev=1060350&view=rev
Log:
Merged revisions 1060345 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1060345 | ffang | 2011-01-18 20:08:00 +0800 (二, 18  1 2011) | 1 line
  
  [CXF-3254]idl2wsdl should be able to honor #if preprocessor
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
    cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C-resolved.idl
    cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C.idl

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java?rev=1060350&r1=1060349&r2=1060350&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
Tue Jan 18 12:37:50 2011
@@ -176,6 +176,8 @@ public final class IdlPreprocessorReader
                 handleIfndef(line);
             } else if (line.startsWith("#ifdef")) {
                 handleIfdef(line);
+            } else if (line.startsWith("#if")) {
+                handleIf(line);
             } else if (line.startsWith("#endif")) {
                 handleEndif(lineNo, ise);
             } else if (line.startsWith("#else")) {
@@ -254,6 +256,21 @@ public final class IdlPreprocessorReader
         registerIf(!isDefined);
         buf.append(LF);
     }
+    
+    private void handleIf(String line) {
+        String symbol = line.substring("#if".length()).trim();
+        boolean notSkip = true;
+        try {
+            int value = Integer.valueOf(symbol);
+            if (value == 0) {
+                notSkip = false;
+            }
+        } catch (NumberFormatException e) {
+            //do nothig
+        }
+        registerIf(!notSkip);
+        buf.append(LF);
+    }
 
     private void handleIfndef(String line) {
         String symbol = line.substring("#ifndef".length()).trim();

Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C-resolved.idl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C-resolved.idl?rev=1060350&r1=1060349&r2=1060350&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C-resolved.idl
(original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C-resolved.idl
Tue Jan 18 12:37:50 2011
@@ -21,6 +21,16 @@ module c
 
 
 // endif _c
+
+
+
+
+
+    const char e = 'e';
+
+
+    const char f = 'f';
+
   };
 };
 

Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C.idl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C.idl?rev=1060350&r1=1060349&r2=1060350&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C.idl (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idlpreprocessor/C.idl Tue Jan
18 12:37:50 2011
@@ -20,6 +20,16 @@ module c
 #else
     const boolean c = TRUE;
 #endif  // endif _c
+
+#if 0
+    const char d = 'd';
+#endif 
+#if 1
+    const char e = 'e';
+#endif
+#if true
+    const char f = 'f';
+#endif
   };
 };
 



Mime
View raw message