determine the ee application name based on information obtained from JNDI.
555436
protected String lookupEeApplicationName() {

    try {
      InitialContext initialContext = new InitialContext();

      String appName = (String) initialContext.lookup(JAVA_APP_APP_NAME_PATH);
      String moduleName = (String) initialContext.lookup(MODULE_NAME_PATH);

      // make sure that if an EAR carries multiple PAs, they are correctly
      // identified by appName + moduleName
      if (moduleName != null && !moduleName.equals(appName)) {
        return appName + "/" + moduleName;
      } else {
        return appName;
      }
    }
    catch (NamingException e) {
      throw LOG.ejbPaCannotAutodetectName(e);
    }
  }
359276
def _dep_id(self, dependency):
    """"""
    params = dict(sep=self.separator)

    if isinstance(dependency, JarDependency):
      # TODO(kwilson): handle 'classifier' and 'type'.
      params.update(org=dependency.org, name=dependency.name, rev=dependency.rev)
      is_internal_dep = False
    else:
      params.update(org='internal', name=dependency.id)
      is_internal_dep = True

    return ('{org}{sep}{name}{sep}{rev}' if params.get('rev') else
            '{org}{sep}{name}').format(**params), is_internal_dep
836782
@Override
    @FFDCIgnore(NullPointerException.class)
    public void applicationStopped(ApplicationInfo appInfo) {
      
        // If we can't get the J2EEName of the application, then we don't care about this application.     
        String appName = appInfo.getDeploymentName();
        if (null == appName) return;
        // Handle an app being stopped
        webModulesInStartingApps.remove(appName);
        webModulesInStartedApps.remove(appName);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Web application stopped- " + appName);
        }
    }
1055415
public String javaName(final JvmVisibility visibility) {
    if ((visibility != null)) {
      String _switchResult = null;
      if (visibility != null) {
        switch (visibility) {
          case PRIVATE:
            _switchResult = "private ";
            break;
          case PUBLIC:
            _switchResult = "public ";
            break;
          case PROTECTED:
            _switchResult = "protected ";
            break;
          case DEFAULT:
            _switchResult = "";
            break;
          default:
            break;
        }
      }
      return _switchResult;
    } else {
      return "";
    }
  }
1225753
private String determineDatabaseProductName(Connection conn) {
        try {
            final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
            LOGGER.debug("Database product: {}", databaseProductName);
            return databaseProductName;
        } catch (SQLException se) {
            LOGGER.warn("Problem determining database product!", se);
            return null;
        }
    }
1013864
def name(self):
        """"""
        return self.TYPES.get(self._type, self.TYPES[idaapi.o_idpspec0])
745943
protected String getDisplayNameOf(Method e, T i) {
        Class<?> c = e.getDeclaringClass();
        String key = displayNameOf(i);
        if (key.length()==0)  return c.getSimpleName()+"."+e.getName();
        try {
            ResourceBundleHolder rb = ResourceBundleHolder.get(
                    c.getClassLoader().loadClass(c.getPackage().getName() + ".Messages"));
            return rb.format(key);
        } catch (ClassNotFoundException x) {
            LOGGER.log(WARNING, "Failed to load "+x.getMessage()+" for "+e.toString(),x);
            return key;
        } catch (MissingResourceException x) {
            LOGGER.log(WARNING, "Could not find key '" + key + "' in " + c.getPackage().getName() + ".Messages", x);
            return key;
        }
    }
280624
private static int getAppVersion(Context context) {
        try {
            PackageInfo packageInfo = context.getPackageManager()
                    .getPackageInfo(context.getPackageName(), 0);
            return packageInfo.versionCode;
        } catch (NameNotFoundException e) {
            // should never happen
            throw new RuntimeException("Coult not get package name: " + e);
        }
    }
971685
protected String extractApplicationLabel(final byte[] pData) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Extract Application label");
		}
		String label = null;
		// Get Preferred name first
		byte[] labelByte = TlvUtil.getValue(pData, EmvTags.APPLICATION_PREFERRED_NAME);
		// Get Application label
		if (labelByte == null) {
			labelByte = TlvUtil.getValue(pData, EmvTags.APPLICATION_LABEL);
		}
		// Convert to String
		if (labelByte != null) {
			label = new String(labelByte);
		}
		return label;
	}
710387
public List<JavaInformations> getJavaInformationsByApplication(String application) {
		// application peut être null
		if (application == null) {
			return null;
		}
		final RemoteCollector remoteCollector = remoteCollectorsByApplication.get(application);
		if (remoteCollector == null) {
			return null;
		}
		return remoteCollector.getJavaInformationsList();
	}
675722
public static function getApplicationName():?string
    {
        if (self::isCliApp()) {
            return self::$APPLICATION_NAME;
        }

        return MSession::get(MCoreApplication::APPLICATION_NAME);
    }
1204467
def _find_usage_application_versions(self):
        """"""
        versions = self.conn.describe_application_versions()
        self.limits['Application versions']._add_current_usage(
            len(versions['ApplicationVersions']),
            aws_type='AWS::ElasticBeanstalk::ApplicationVersion',
        )
31719
def check_name(self, name=None):
        '''
        
        '''
        if name:
            self.plugin_info['check_name'] = name

        if self.plugin_info['check_name'] is not None:
            return self.plugin_info['check_name']

        return self.__class__.__name__
1142337
@Override
    public String getName() {
        Enterprise enterprise = model.getEnterprise();
        return "System Landscape" + (enterprise != null && enterprise.getName().trim().length() > 0 ? " for " + enterprise.getName() : "");
    }
851026
def parse_application_name(setup_filename):
        
        with open(setup_filename, 'rt') as setup_file:
            fst = RedBaron(setup_file.read())
            for node in fst:
                if (
                    node.type == 'atomtrailers' and
                    str(node.name) == 'setup'
                ):
                    for call in node.call:
                        if str(call.name) == 'name':
                            value = call.value
                            if hasattr(value, 'to_python'):
                                value = value.to_python()
                            name = str(value)
                            break
                    if name:
                        break
        return name
1057250
public Collection<Metric> metricNames(long applicationId, String name)
    {
        QueryParameterList queryParams = new QueryParameterList();
        if(name != null && name.length() > 0)
            queryParams.add("name", name);
        return HTTP.GET(String.format("/v2/mobile_applications/%d/metrics.json", applicationId), null, queryParams, METRICS).get();
    }
1175828
def get_app_name(self):
        
        main_activity_name = self.get_main_activity()

        app_name = self.get_element('activity', 'label', name=main_activity_name)
        if not app_name:
            app_name = self.get_element('application', 'label')

        if app_name.startswith("@"):
            res_id = int(app_name[1:], 16)
            res_parser = self.get_android_resources()

            try:
                app_name = res_parser.get_resolved_res_configs(
                    res_id,
                    ARSCResTableConfig.default_config())[0][1]
            except Exception as e:
                anconf.warning("Exception selecting app name: %s" % e)
                app_name = ""
        return app_name