Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2363

ExceptionAnalysis generate incorrect IDL name due to keyword collisions

XMLWordPrintable

      Here we will check for IDL keyword collisions. This means that the repository ID for foo.exception.SomeException is "IDL:foo/_exception/SomeEx:1.0" (note the underscore in front of the exception module name).

      JBoss currently does not check the package name for keywork collisions.

      Following fast hack solves the above issue:

      Inside org.jboss.iiop.rmi.ExceptionAnalysis

      protected void doAnalyze()
      throws RMIIIOPViolationException
      {
      super.doAnalyze();

      if (!Exception.class.isAssignableFrom(cls) ||
      RuntimeException.class.isAssignableFrom(cls))
      throw new RMIIIOPViolationException(
      "Exception type " + cls.getName() +
      " must be a checked exception class.", "1.2.6");

      // calculate exceptionRepositoryId
      String s = null;
      StringTokenizer token = new StringTokenizer(cls.getPackage().getName(), ".");
      while(token.hasMoreTokens())

      { // might not be safe to use javaToIDLName for package names, but it seems to work for now String t = Util.javaToIDLName(token.nextToken()); if(s == null) s = t; else s = s + "/" + t; }

      StringBuffer b = new StringBuffer("IDL:");
      b.append(s);
      b.append('/');

      String base = cls.getName();
      base = base.substring(base.lastIndexOf('.')+1);
      if (base.endsWith("Exception"))
      base = base.substring(0, base.length()-9);
      base = Util.javaToIDLName(base + "Ex");

      b.append(base).append(":1.0");
      exceptionRepositoryId = b.toString();
      }

              reverbel Francisco Reverbel (Inactive)
              mjelle Martin Jelle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: