[jboss-cvs] JBossAS SVN: r107432 - in projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common: api/metadata/ra and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 5 05:01:23 EDT 2010


Author: maeste
Date: 2010-08-05 05:01:22 -0400 (Thu, 05 Aug 2010)
New Revision: 107432

Modified:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Connector.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/Connector10.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra15/Connector15.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra16/Connector16.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java
Log:
JBJCA-385: fixing a bug with 1.5 reported by Jeff

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -384,8 +384,8 @@
             outboundResourceadapter, inboundResourceadapter, adminObjs, securityPermissions, null);
 
       XsdString resourceadapterVersion = new XsdString("1.6", null);
-      return new Connector16Impl("", descriptions, displayNames, icons, vendorName, eisType,
-            resourceadapterVersion, license, resourceAdapter, requiredWorkContexts, false, null);
+      return new Connector16Impl("", vendorName, eisType, resourceadapterVersion, license, resourceAdapter,
+            requiredWorkContexts, false, descriptions, displayNames, icons, null);
 
    }
 

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Connector.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Connector.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Connector.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -21,6 +21,8 @@
  */
 package org.jboss.jca.common.api.metadata.ra;
 
+import java.util.List;
+
 /**
  *
  * A Connector.
@@ -60,6 +62,21 @@
    public abstract ResourceAdapter getResourceadapter();
 
    /**
+    * @return description
+    */
+   public abstract List<LocalizedXsdString> getDescriptions();
+
+   /**
+    * @return displayName
+    */
+   public abstract List<LocalizedXsdString> getDisplayNames();
+
+   /**
+    * @return icon
+    */
+   public abstract List<Icon> getIcons();
+
+   /**
     * Get the version.
     *
     * @return the version.

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/Connector10.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/Connector10.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/Connector10.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -22,12 +22,8 @@
 package org.jboss.jca.common.api.metadata.ra.ra10;
 
 import org.jboss.jca.common.api.metadata.ra.Connector;
-import org.jboss.jca.common.api.metadata.ra.Icon;
-import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
-import org.jboss.jca.common.api.metadata.ra.XsdString;
 
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -45,23 +41,8 @@
     */
    public abstract String getModuleName();
 
-   /**
-    * @return description
-    */
-   public abstract List<LocalizedXsdString> getDescriptions();
 
    /**
-    * @return displayName
-    */
-   public abstract XsdString getDisplayName();
-
-   /**
-    * @return icon
-    */
-   public abstract List<Icon> getIcons();
-
-
-   /**
    *
    * A Tag.
    *
@@ -105,30 +86,32 @@
        */
       RESOURCEADAPTER("resourceadapter"),
 
+
       /**
-       * description tag
+       * spec-version TAG
        */
-      DESCRIPTION("description"),
+      SPEC_VERSION("spec-version"),
 
       /**
-       * icon tag
+       * version TAG
        */
-      ICON("icon"),
+      VERSION("version"),
 
       /**
-       * spec-version TAG
+       * description tag
        */
-      SPEC_VERSION("spec-version"),
+      DESCRIPTION("description"),
 
       /**
-       * version TAG
+       * icon tag
        */
-      VERSION("version"),
+      ICON("icon"),
 
       /**
        * display-name tag
        */
       DISPLAY_NAME("display-name");
+
       private final String name;
 
       /**

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra15/Connector15.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra15/Connector15.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra15/Connector15.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -86,8 +86,18 @@
        */
       RESOURCEADAPTER("resourceadapter"),
       /**
-       * resourceadapter tag
+       * description tag
        */
+      DESCRIPTION("description"),
+
+      /**
+       * icon tag
+       */
+      ICON("icon"),
+
+      /**
+       * display-name tag
+       */
       DISPLAY_NAME("display-name");
 
       private final String name;

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra16/Connector16.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra16/Connector16.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra16/Connector16.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -137,6 +137,7 @@
        * display-name tag
        */
       DISPLAY_NAME("display-name");
+
       private final String name;
 
       /**

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -187,7 +187,7 @@
       ResourceAdapter10 resourceadapter = null;
       XsdString vendorName = NULL_XSDSTRING;
       String moduleName = null;
-      XsdString displayName = NULL_XSDSTRING;
+      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
       XsdString resourceadapterVersion = NULL_XSDSTRING;
       while (reader.hasNext())
       {
@@ -202,8 +202,8 @@
                   description.trimToSize();
 
                   //building and returning object
-                  return new Connector10Impl(moduleName, description, displayName, icon, vendorName, eisType,
-                        resourceadapterVersion, license, resourceadapter, id);
+                  return new Connector10Impl(moduleName, vendorName, eisType,
+                        resourceadapterVersion, license, resourceadapter, description, displayName, icon, id);
 
                }
                else
@@ -247,7 +247,7 @@
                      break;
                   }
                   case DISPLAY_NAME : {
-                     displayName = elementAsLocalizedXsdString(reader);
+                     displayName.add(elementAsLocalizedXsdString(reader));
                      break;
                   }
                   case ICON : {
@@ -278,6 +278,10 @@
       ResourceAdapter1516 resourceadapter = null;
       XsdString vendorName = NULL_XSDSTRING;
       XsdString resourceadapterVersion = NULL_XSDSTRING;
+      ArrayList<Icon> icon = new ArrayList<Icon>();
+      ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
+
       while (reader.hasNext())
       {
          switch (reader.nextTag())
@@ -287,7 +291,8 @@
                {
 
                   //building and returning object
-                  return new Connector15Impl(vendorName, eisType, resourceadapterVersion, license, resourceadapter, id);
+                  return new Connector15Impl(vendorName, eisType, resourceadapterVersion, license, resourceadapter,
+                        description, displayName, icon, id);
 
                }
                else
@@ -322,10 +327,18 @@
                      resourceadapter = parseResourceAdapter(reader);
                      break;
                   }
+                  case DESCRIPTION : {
+                     description.add(elementAsLocalizedXsdString(reader));
+                     break;
+                  }
                   case DISPLAY_NAME : {
-                     elementAsLocalizedXsdString(reader);
+                     displayName.add(elementAsLocalizedXsdString(reader));
                      break;
                   }
+                  case ICON : {
+                     icon.add(parseIcon(reader));
+                     break;
+                  }
                   default :
                      throw new ParserException("Unexpected element:" + reader.getLocalName());
                }
@@ -344,11 +357,11 @@
       String id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());;
       ArrayList<Icon> icon = new ArrayList<Icon>();
       ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
       XsdString eisType = NULL_XSDSTRING;
       ResourceAdapter1516 resourceadapter = null;
       XsdString vendorName = NULL_XSDSTRING;
       String moduleName = null;
-      ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
       ArrayList<String> requiredWorkContext = new ArrayList<String>();
       XsdString resourceadapterVersion = NULL_XSDSTRING;
       while (reader.hasNext())
@@ -365,8 +378,8 @@
                   displayName.trimToSize();
                   requiredWorkContext.trimToSize();
                   //building and returning object
-                  return new Connector16Impl(moduleName, description, displayName, icon, vendorName, eisType,
-                        resourceadapterVersion, license, resourceadapter, requiredWorkContext, metadataComplete, id);
+                  return new Connector16Impl(moduleName, vendorName, eisType, resourceadapterVersion, license,
+                        resourceadapter, requiredWorkContext, metadataComplete, description, displayName, icon, id);
 
                }
                else

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -24,7 +24,9 @@
 import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
 import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
 import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.api.metadata.ra.Icon;
 import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
 import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
 import org.jboss.jca.common.api.metadata.ra.OverrideElementAttribute;
 import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
@@ -37,6 +39,7 @@
 import org.jboss.jca.common.api.validator.ValidateException;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -79,16 +82,35 @@
    protected final String id;
 
    /**
+    * description
+    */
+   protected final ArrayList<LocalizedXsdString> description;
+
+   /**
+    * displayName
+    */
+   protected final ArrayList<LocalizedXsdString> displayName;
+
+   /**
+    * icon
+    */
+   protected final ArrayList<Icon> icon;
+
+   /**
     * Create a new Connector.
     *
     * @param vendorName vandor name
     * @param eisType tyeo of EIS
     * @param license license information
     * @param resourceadapter resource adapter instance
+    * @param description descriptions of this connector
+    * @param displayName name to display for this connecotro
+    * @param icon icon representing this connectore
     * @param id id attribute in xml file
     */
    protected ConnectorAbstractmpl(XsdString vendorName, XsdString eisType, LicenseType license,
-         ResourceAdapter resourceadapter, String id)
+         ResourceAdapter resourceadapter, List<LocalizedXsdString> description, List<LocalizedXsdString> displayName,
+         List<Icon> icon, String id)
    {
       super();
       this.vendorName = vendorName;
@@ -96,6 +118,33 @@
       this.license = license;
       this.resourceadapter = resourceadapter;
       this.id = id;
+      if (description != null)
+      {
+         this.description = new ArrayList<LocalizedXsdString>(description.size());
+         this.description.addAll(description);
+      }
+      else
+      {
+         this.description = new ArrayList<LocalizedXsdString>(0);
+      }
+      if (displayName != null)
+      {
+         this.displayName = new ArrayList<LocalizedXsdString>(displayName.size());
+         this.displayName.addAll(description);
+      }
+      else
+      {
+         this.displayName = new ArrayList<LocalizedXsdString>(0);
+      }
+      if (icon != null)
+      {
+         this.icon = new ArrayList<Icon>(icon.size());
+         this.icon.addAll(icon);
+      }
+      else
+      {
+         this.icon = new ArrayList<Icon>(0);
+      }
    }
 
    /**
@@ -143,6 +192,33 @@
    }
 
    /**
+    * @return description
+    */
+   @Override
+   public List<LocalizedXsdString> getDescriptions()
+   {
+      return description == null ? null : Collections.unmodifiableList(description);
+   }
+
+   /**
+    * @return displayName
+    */
+   @Override
+   public List<LocalizedXsdString> getDisplayNames()
+   {
+      return displayName == null ? null : Collections.unmodifiableList(displayName);
+   }
+
+   /**
+    * @return icon
+    */
+   @Override
+   public List<Icon> getIcons()
+   {
+      return icon == null ? null : Collections.unmodifiableList(icon);
+   }
+
+   /**
     * Get the id.
     *
     * @return the id.

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -29,8 +29,6 @@
 import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
 import org.jboss.jca.common.metadata.ra.common.ConnectorAbstractmpl;
 
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 /**
@@ -46,12 +44,6 @@
 
    private final String moduleName;
 
-   private final ArrayList<LocalizedXsdString> description;
-
-   private final XsdString displayName;
-
-   private final ArrayList<Icon> icon;
-
    /**
     * @param moduleName name of the module
     * @param description descriptions of this connector
@@ -64,32 +56,15 @@
     * @param resourceadapter full qualified name of the resource adapter
     * @param id XML ID
     */
-   public Connector10Impl(String moduleName, List<LocalizedXsdString> description, XsdString displayName,
-         List<Icon> icon, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
-         LicenseType license, ResourceAdapter resourceadapter, String id)
+   public Connector10Impl(String moduleName, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+         LicenseType license, ResourceAdapter resourceadapter, List<LocalizedXsdString> description,
+         List<LocalizedXsdString> displayName,
+         List<Icon> icon, String id)
    {
-      super(vendorName, eisType, license, resourceadapter, id);
+      super(vendorName, eisType, license, resourceadapter, description, displayName, icon, id);
       this.moduleName = moduleName;
-      if (description != null)
-      {
-         this.description = new ArrayList<LocalizedXsdString>(description.size());
-         this.description.addAll(description);
-      }
-      else
-      {
-         this.description = new ArrayList<LocalizedXsdString>(0);
-      }
-      this.displayName = displayName;
-      if (icon != null)
-      {
-         this.icon = new ArrayList<Icon>(icon.size());
-         this.icon.addAll(icon);
-      }
-      else
-      {
-         this.icon = new ArrayList<Icon>(0);
-      }
 
+
    }
 
    /**
@@ -102,33 +77,6 @@
    }
 
    /**
-    * @return description
-    */
-   @Override
-   public List<LocalizedXsdString> getDescriptions()
-   {
-      return description == null ? null : Collections.unmodifiableList(description);
-   }
-
-   /**
-    * @return displayName
-    */
-   @Override
-   public XsdString getDisplayName()
-   {
-      return displayName;
-   }
-
-   /**
-    * @return icon
-    */
-   @Override
-   public List<Icon> getIcons()
-   {
-      return icon == null ? null : Collections.unmodifiableList(icon);
-   }
-
-   /**
     * Get the version.
     *
     * @return the version.
@@ -154,9 +102,6 @@
    {
       final int prime = 31;
       int result = super.hashCode();
-      result = prime * result + ((description == null) ? 0 : description.hashCode());
-      result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
-      result = prime * result + ((icon == null) ? 0 : icon.hashCode());
       result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
       return result;
    }
@@ -171,27 +116,6 @@
       if (!(obj instanceof Connector10Impl))
          return false;
       Connector10Impl other = (Connector10Impl) obj;
-      if (description == null)
-      {
-         if (other.description != null)
-            return false;
-      }
-      else if (!description.equals(other.description))
-         return false;
-      if (displayName == null)
-      {
-         if (other.displayName != null)
-            return false;
-      }
-      else if (!displayName.equals(other.displayName))
-         return false;
-      if (icon == null)
-      {
-         if (other.icon != null)
-            return false;
-      }
-      else if (!icon.equals(other.icon))
-         return false;
       if (moduleName == null)
       {
          if (other.moduleName != null)
@@ -199,20 +123,18 @@
       }
       else if (!moduleName.equals(other.moduleName))
          return false;
-
       return true;
    }
 
    @Override
    public String toString()
    {
-      return "Connector10 [moduleName=" + moduleName + ", description=" + description + ", displayName=" + displayName
-            + ", version=" + Version.V_10 + ", specVersion=" + Version.V_10 + ", icon=" + icon + ", vendorName="
-            + vendorName
-            + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter + ", id=" + id
-            + "]";
+      return "Connector10Impl [moduleName=" + moduleName + ", vendorName=" + vendorName + ", eisType=" + eisType
+            + ", license=" + license + ", resourceadapter=" + resourceadapter + ", id=" + id + ", description="
+            + description + ", displayName=" + displayName + ", icon=" + icon + "]";
    }
 
 
 
+
 }

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -21,12 +21,16 @@
  */
 package org.jboss.jca.common.metadata.ra.ra15;
 
+import org.jboss.jca.common.api.metadata.ra.Icon;
 import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
 import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
 import org.jboss.jca.common.api.metadata.ra.XsdString;
 import org.jboss.jca.common.api.metadata.ra.ra15.Connector15;
 import org.jboss.jca.common.metadata.ra.common.ConnectorAbstractmpl;
 
+import java.util.List;
+
 /**
  *
  * A Connector15.
@@ -45,19 +49,22 @@
     */
    protected final XsdString resourceadapterVersion;
 
-
    /**
     * @param vendorName vendor name
     * @param eisType eis type
     * @param resourceadapterVersion version number for the RA
     * @param license license information
     * @param resourceadapter full qualified name of the resource adapter
+    * @param description descriptions of this connector
+    * @param displayName name to display for this connecotro
+    * @param icon icon representing this connectore
     * @param id XML ID
     */
    public Connector15Impl(XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
-         LicenseType license, ResourceAdapter1516 resourceadapter, String id)
+         LicenseType license, ResourceAdapter1516 resourceadapter, List<LocalizedXsdString> description,
+         List<LocalizedXsdString> displayName, List<Icon> icon, String id)
    {
-      super(vendorName, eisType, license, resourceadapter, id);
+      super(vendorName, eisType, license, resourceadapter, description, displayName, icon, id);
       this.resourceadapterVersion = resourceadapterVersion;
    }
 
@@ -107,19 +114,16 @@
       }
       else if (!resourceadapterVersion.equals(other.resourceadapterVersion))
          return false;
-
       return true;
    }
 
    @Override
    public String toString()
    {
-      return "Connector15 [version=" + Version.V_15 + ", resourceadapterVersion=" + resourceadapterVersion
-            + ", vendorName="
-            + vendorName + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter
-            + ", id=" + id + "]";
+      return "Connector15Impl [resourceadapterVersion=" + resourceadapterVersion + ", vendorName=" + vendorName
+            + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter + ", id=" + id
+            + ", description=" + description + ", displayName=" + displayName + ", icon=" + icon + "]";
    }
 
 
-
 }

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java	2010-08-05 07:06:17 UTC (rev 107431)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java	2010-08-05 09:01:22 UTC (rev 107432)
@@ -50,21 +50,12 @@
 
    private final String moduleName;
 
-   private final ArrayList<Icon> icons;
-
    private final ArrayList<String> requiredWorkContexts;
 
-   private final ArrayList<LocalizedXsdString> description;
-
-   private final ArrayList<LocalizedXsdString> displayNames;
-
    private final boolean metadataComplete;
 
    /**
     * @param moduleName name of the module
-    * @param description descriptions of this connector
-    * @param displayNames name to display for this connecotro
-    * @param icons icon representing this connectore
     * @param vendorName vendor name
     * @param eisType eis type
     * @param resourceadapterVersion version number for the RA
@@ -72,43 +63,20 @@
     * @param resourceadapter full qualified name of the resource adapter
     * @param requiredWorkContexts list od work context required
     * @param metadataComplete not mandatory boolean value
+    * @param description descriptions of this connector
+    * @param displayNames name to display for this connecotro
+    * @param icons icon representing this connectore
     * @param id XML ID
     */
-   public Connector16Impl(String moduleName, List<LocalizedXsdString> description,
-         List<LocalizedXsdString> displayNames,
-         List<Icon> icons, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+   public Connector16Impl(String moduleName, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
          LicenseType license, ResourceAdapter1516 resourceadapter, List<String> requiredWorkContexts,
-         boolean metadataComplete, String id)
+         boolean metadataComplete, List<LocalizedXsdString> description, List<LocalizedXsdString> displayNames,
+         List<Icon> icons, String id)
    {
-      super(vendorName, eisType, resourceadapterVersion, license, resourceadapter, id);
+      super(vendorName, eisType, resourceadapterVersion, license, resourceadapter,
+            description, displayNames, icons, id);
       this.moduleName = moduleName;
-      if (description != null)
-      {
-         this.description = new ArrayList<LocalizedXsdString>(description.size());
-         this.description.addAll(description);
-      }
-      else
-      {
-         this.description = new ArrayList<LocalizedXsdString>(0);
-      }
-      if (displayNames != null)
-      {
-         this.displayNames = new ArrayList<LocalizedXsdString>(displayNames.size());
-         this.displayNames.addAll(displayNames);
-      }
-      else
-      {
-         this.displayNames = new ArrayList<LocalizedXsdString>(0);
-      }
-      if (icons != null)
-      {
-         this.icons = new ArrayList<Icon>(icons.size());
-         this.icons.addAll(icons);
-      }
-      else
-      {
-         this.icons = new ArrayList<Icon>(0);
-      }
+
       if (requiredWorkContexts != null)
       {
          this.requiredWorkContexts = new ArrayList<String>(requiredWorkContexts.size());
@@ -148,25 +116,8 @@
       return description == null ? null : Collections.unmodifiableList(description);
    }
 
-   /**
-    * @return displayName
-    */
-   @Override
-   public List<LocalizedXsdString> getDisplayNames()
-   {
-      return displayNames == null ? null : Collections.unmodifiableList(displayNames);
-   }
 
    /**
-    * @return icon
-    */
-   @Override
-   public List<Icon> getIcons()
-   {
-      return icons == null ? null : Collections.unmodifiableList(icons);
-   }
-
-   /**
     * @return metadataComplete
     */
    @Override
@@ -186,190 +137,55 @@
       return Version.V_16;
    }
 
+
    @Override
    public int hashCode()
    {
       final int prime = 31;
-      int result = 1;
-      result = prime * result + ((description == null) ? 0 : description.hashCode());
-      result = prime * result + ((displayNames == null) ? 0 : displayNames.hashCode());
-      result = prime * result + ((eisType == null) ? 0 : eisType.hashCode());
-      result = prime * result + ((icons == null) ? 0 : icons.hashCode());
-      result = prime * result + ((id == null) ? 0 : id.hashCode());
-      result = prime * result + ((license == null) ? 0 : license.hashCode());
+      int result = super.hashCode();
+      result = prime * result + (metadataComplete ? 1231 : 1237);
       result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
       result = prime * result + ((requiredWorkContexts == null) ? 0 : requiredWorkContexts.hashCode());
-      result = prime * result + ((resourceadapter == null) ? 0 : resourceadapter.hashCode());
-      result = prime * result + ((resourceadapterVersion == null) ? 0 : resourceadapterVersion.hashCode());
-      result = prime * result + ((vendorName == null) ? 0 : vendorName.hashCode());
       return result;
    }
 
-   /**
-    * {@inheritDoc}
-    *
-    * @see java.lang.Object#equals(java.lang.Object)
-    */
    @Override
    public boolean equals(Object obj)
    {
       if (this == obj)
-      {
          return true;
-      }
-      if (obj == null)
-      {
+      if (!super.equals(obj))
          return false;
-      }
       if (!(obj instanceof Connector16Impl))
-      {
          return false;
-      }
       Connector16Impl other = (Connector16Impl) obj;
-      if (description == null)
-      {
-         if (other.description != null)
-         {
-            return false;
-         }
-      }
-      else if (!description.equals(other.description))
-      {
-         return false;
-      }
-      if (displayNames == null)
-      {
-         if (other.displayNames != null)
-         {
-            return false;
-         }
-      }
-      else if (!displayNames.equals(other.displayNames))
-      {
-         return false;
-      }
-      if (eisType == null)
-      {
-         if (other.eisType != null)
-         {
-            return false;
-         }
-      }
-      else if (!eisType.equals(other.eisType))
-      {
-         return false;
-      }
-      if (icons == null)
-      {
-         if (other.icons != null)
-         {
-            return false;
-         }
-      }
-      else if (!icons.equals(other.icons))
-      {
-         return false;
-      }
-      if (id == null)
-      {
-         if (other.id != null)
-         {
-            return false;
-         }
-      }
-      else if (!id.equals(other.id))
-      {
-         return false;
-      }
-      if (license == null)
-      {
-         if (other.license != null)
-         {
-            return false;
-         }
-      }
-      else if (!license.equals(other.license))
-      {
-         return false;
-      }
       if (metadataComplete != other.metadataComplete)
-      {
          return false;
-      }
       if (moduleName == null)
       {
          if (other.moduleName != null)
-         {
             return false;
-         }
       }
       else if (!moduleName.equals(other.moduleName))
-      {
          return false;
-      }
       if (requiredWorkContexts == null)
       {
          if (other.requiredWorkContexts != null)
-         {
             return false;
-         }
       }
       else if (!requiredWorkContexts.equals(other.requiredWorkContexts))
-      {
          return false;
-      }
-      if (resourceadapter == null)
-      {
-         if (other.resourceadapter != null)
-         {
-            return false;
-         }
-      }
-      else if (!resourceadapter.equals(other.resourceadapter))
-      {
-         return false;
-      }
-      if (resourceadapterVersion == null)
-      {
-         if (other.resourceadapterVersion != null)
-         {
-            return false;
-         }
-      }
-      else if (!resourceadapterVersion.equals(other.resourceadapterVersion))
-      {
-         return false;
-      }
-      if (vendorName == null)
-      {
-         if (other.vendorName != null)
-         {
-            return false;
-         }
-      }
-      else if (!vendorName.equals(other.vendorName))
-      {
-         return false;
-      }
-
       return true;
    }
 
-
-   /**
-    * {@inheritDoc}
-    *
-    * @see java.lang.Object#toString()
-    */
    @Override
    public String toString()
    {
-      return "Connector16 [moduleName=" + moduleName + ", description=" + description + ", displayNames="
-            + displayNames
-            + ", icons=" + icons + ", vendorName=" + vendorName + ", eisType=" + eisType + ", resourceadapterVersion="
-            + resourceadapterVersion + ", license=" + license + ", resourceadapter=" + resourceadapter
-            + ", requiredWorkContexts=" + requiredWorkContexts + ", version=" + Version.V_15 + ", metadataComplete="
-            + metadataComplete + ", id=" + id + "]";
+      return "Connector16Impl [moduleName=" + moduleName + ", requiredWorkContexts=" + requiredWorkContexts
+            + ", metadataComplete=" + metadataComplete + ", resourceadapterVersion=" + resourceadapterVersion
+            + ", vendorName=" + vendorName + ", eisType=" + eisType + ", license=" + license + ", resourceadapter="
+            + resourceadapter + ", id=" + id + ", description=" + description + ", displayName=" + displayName
+            + ", icon=" + icon + "]";
    }
 
    @Override
@@ -390,22 +206,22 @@
          List<String> newRequiredWorkContexts = MergeUtil.mergeList(this.requiredWorkContexts,
                input16.requiredWorkContexts);
          String newModuleName = this.moduleName == null ? input16.moduleName : this.moduleName;
-         List<Icon> newIcons = MergeUtil.mergeList(this.icons, input16.icons);
+         List<Icon> newIcons = MergeUtil.mergeList(this.icon, input16.icon);
          boolean newMetadataComplete = this.metadataComplete || input16.metadataComplete;
          LicenseType newLicense = this.license == null ? input16.license : this.license.merge(input16.license);
          List<LocalizedXsdString> newDescriptions = MergeUtil.mergeList(this.description,
                input16.description);
-         List<LocalizedXsdString> newDisplayNames = MergeUtil.mergeList(this.displayNames,
-               input16.displayNames);
+         List<LocalizedXsdString> newDisplayNames = MergeUtil.mergeList(this.displayName,
+               input16.displayName);
          XsdString newVendorName = XsdString.isNull(this.vendorName)
                ? input16.vendorName : this.vendorName;;
          ResourceAdapter1516 newResourceadapter = this.resourceadapter == null
                ? (ResourceAdapter1516) input16.resourceadapter
                : ((ResourceAdapter1516) this.resourceadapter)
                .merge((ResourceAdapter1516) input16.resourceadapter);
-         return new Connector16Impl(newModuleName, newDescriptions, newDisplayNames, newIcons,
-               newVendorName, newEisType, newResourceadapterVersion, newLicense, newResourceadapter,
-               newRequiredWorkContexts, newMetadataComplete, newModuleName);
+         return new Connector16Impl(newModuleName, newVendorName, newEisType, newResourceadapterVersion, newLicense,
+               newResourceadapter, newRequiredWorkContexts, newMetadataComplete, newDescriptions, newDisplayNames,
+               newIcons, null);
       }
       return this;
 



More information about the jboss-cvs-commits mailing list