code: private static String getDisplayName(String displayName,
                                           J2EEName j2eeName,
                                           boolean isClient)
      {
          String rtnName = displayName;
  
          if (rtnName == null ||
              rtnName.equals(""))
          {
              if (j2eeName != null)
              {
                  rtnName = j2eeName.getComponent();
  
                  if (rtnName == null ||
                      rtnName.equals(""))
                  {
                      rtnName = j2eeName.getModule();
  
                      if (rtnName != null &&
                          (rtnName.endsWith(".war") ||
                          rtnName.endsWith(".jar")))
                      {
                          rtnName = rtnName.substring(0, rtnName.length() - 4);
                      }
                  }
  
                  if (rtnName == null ||
                      rtnName.equals(""))
                  {
                      rtnName = j2eeName.getApplication();
                  }
              }
  
              if (rtnName == null ||
                  rtnName.equals(""))
              {
                  if (isClient)
                  {
                      rtnName = "CLIENT";
                  }
                  else
                  {
                      rtnName = "SERVLET";
                  }
              }
          }
  
          return rtnName;
      }
docs: d531837