incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r573007 - in /incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl: ArrayDescriptor.java ModelElement.java SimpleDescriptor.java StringDescriptor.java TypeDescriptor.java
Date Wed, 05 Sep 2007 17:19:35 GMT
Author: rickmcguire
Date: Wed Sep  5 10:19:35 2007
New Revision: 573007

URL: http://svn.apache.org/viewvc?rev=573007&view=rev
Log:
YOKO-414 RMI long array marshalling code generating incorrect operation name.


Modified:
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ArrayDescriptor.java
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ModelElement.java
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
    incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ArrayDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ArrayDescriptor.java?rev=573007&r1=573006&r2=573007&view=diff
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ArrayDescriptor.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ArrayDescriptor.java
Wed Sep  5 10:19:35 2007
@@ -95,20 +95,19 @@
         StringBuffer sb = new StringBuffer("org_omg_boxedRMI_");
 
         TypeDescriptor desc = getTypeRepository().getDescriptor(basicType);
-        String elemName = desc.getIDLName();
-
-        int idx = elemName.lastIndexOf('_');
-
-        String pkgName = elemName.substring(0, idx + 1);
-        String elmName = elemName.substring(idx + 1);
-
-        sb.append(pkgName);
-
-        sb.append("seq");
+        
+        String pkgName = desc.getPackageName(); 
+        if (pkgName.length() > 0) {
+            sb.append(desc.getPackageName());
+            sb.append("_seq");
+        }
+        else {
+            sb.append("seq");
+        }
         sb.append(order);
         sb.append('_');
 
-        sb.append(elmName);
+        sb.append(desc.getTypeName());
 
         return sb.toString();
     }

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ModelElement.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ModelElement.java?rev=573007&r1=573006&r2=573007&view=diff
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ModelElement.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ModelElement.java
Wed Sep  5 10:19:35 2007
@@ -19,17 +19,34 @@
 package org.apache.yoko.rmi.impl;
 
 public class ModelElement {
-    protected String idl_name;
+    protected String idl_name;        // fully resolved package name
+    protected String type_name = "";       // the simple type name (minus package, if any)
+    protected String package_name = "";    // the package name qualifier (if any)
+    protected String java_name;       // the java name of the type 
 
     protected void setIDLName(String name) {
         idl_name = name;
     }
-
+    
     public String getIDLName() {
         return idl_name;
     }
 
-    protected String java_name;
+    protected void setTypeName(String name) {
+        type_name = name;
+    }
+    
+    public String getTypeName() {
+        return type_name;
+    }
+
+    protected void setPackageName(String name) {
+        package_name = name;
+    }
+    
+    public String getPackageName() {
+        return package_name;
+    }
 
     protected void setJavaName(String name) {
         java_name = name;

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java?rev=573007&r1=573006&r2=573007&view=diff
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
Wed Sep  5 10:19:35 2007
@@ -24,6 +24,10 @@
         super(type, repository);
         setJavaName(type.getName());
         setIDLName(idl_name);
+        // the simple type name is the same as the IDL name.  The 
+        // package name is null 
+        setTypeName(idl_name); 
+        setPackageName("");
 
         org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
         _type_code = orb.get_primitive_tc(tc);

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java?rev=573007&r1=573006&r2=573007&view=diff
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
Wed Sep  5 10:19:35 2007
@@ -22,9 +22,12 @@
     public String getIDLName() {
         return "CORBA_WStringValue";
     }
-
+    
     StringDescriptor(TypeRepository repository) {
         super(String.class, repository);
+        // strings have a special type and package name other than the java class name. 
+        setTypeName("WStringValue"); 
+        setPackageName("CORBA"); 
     }
 
     public void init() {

Modified: incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java?rev=573007&r1=573006&r2=573007&view=diff
==============================================================================
--- incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
(original)
+++ incubator/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
Wed Sep  5 10:19:35 2007
@@ -41,8 +41,21 @@
 
     protected TypeDescriptor(Class type, TypeRepository repository) {
         _java_class = type;
+        String typeName = type.getName(); 
         setTypeRepository(repository);
-        setIDLName(type.getName().replace('.', '_'));
+        setIDLName(typeName.replace('.', '_'));
+        // break up the simple type and package
+        int idx = typeName.lastIndexOf('.');
+        // if we have a package, split it into the component parts
+        if (idx >= 0) {
+            setPackageName(typeName.substring(0, idx));
+            setTypeName(typeName.substring(idx + 1));
+        }
+        else {
+            // no package...the type is the simple name
+            setPackageName(""); 
+            setTypeName(typeName); 
+        }
     }
 
     public String getRepositoryIDForArray() {



Mime
View raw message