[jboss-cvs] JBossAS SVN: r63378 - trunk/iiop/src/main/org/jboss/iiop/rmi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 6 17:06:52 EDT 2007


Author: dimitris at jboss.org
Date: 2007-06-06 17:06:52 -0400 (Wed, 06 Jun 2007)
New Revision: 63378

Modified:
   trunk/iiop/src/main/org/jboss/iiop/rmi/ContainerAnalysis.java
Log:
JBAS-4473, java to IDL mapping erroneously treats a 'get' method as an attribute

Modified: trunk/iiop/src/main/org/jboss/iiop/rmi/ContainerAnalysis.java
===================================================================
--- trunk/iiop/src/main/org/jboss/iiop/rmi/ContainerAnalysis.java	2007-06-06 21:05:55 UTC (rev 63377)
+++ trunk/iiop/src/main/org/jboss/iiop/rmi/ContainerAnalysis.java	2007-06-06 21:06:52 UTC (rev 63378)
@@ -1,33 +1,32 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.iiop.rmi;
 
+import java.io.Externalizable;
+import java.io.ObjectStreamClass;
+import java.io.Serializable;
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
-
-import java.io.ObjectStreamClass;
-import java.io.Serializable;
-import java.io.Externalizable;
 import java.util.ArrayList;
 
 /**
@@ -37,6 +36,7 @@
  *  Specification", version 1.1 (01-06-07).
  *      
  *  @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
+ *  @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  *  @version $Revision$
  */
 public abstract class ContainerAnalysis
@@ -306,9 +306,11 @@
    protected boolean isAccessor(Method m)
    {
      Class returnType = m.getReturnType();
- 
-     if (!m.getName().startsWith("get"))
-        if (!m.getName().startsWith("is") || !(returnType == Boolean.TYPE))
+     // JBAS-4473, look for get<name>()
+     String name = m.getName();
+     if (!(name.startsWith("get") && name.length() > "get".length()))
+        if (!(name.startsWith("is") && name.length() > "is".length())
+              || !(returnType == Boolean.TYPE))
            return false;
      if (returnType == Void.TYPE)
          return false;
@@ -323,7 +325,9 @@
     */
    protected boolean isMutator(Method m)
    {
-     if (!m.getName().startsWith("set"))
+     // JBAS-4473, look for set<name>()
+     String name = m.getName();
+     if (!(name.startsWith("set") && name.length() > "set".length()))
          return false;
      if (m.getReturnType() != Void.TYPE)
          return false;




More information about the jboss-cvs-commits mailing list