public static void registerApp(int application,String appName) throws AppIDException {
  if ((application & APP_ID_MASK) != application) {
    throw new InvalidAppIDValueException(application);
  }
  String oldApp=appIdMap.putIfAbsent(application,appName);
  if (oldApp != null && !oldApp.equals(appName)) {
    throw new AppIDInUseException(application,oldApp,appName);
  }
}

public static void registerApp ( int application , String appName ) throws AppIDException { if ( ( application & APP_ID_MASK ) != application ) { throw new InvalidAppIDValueException ( application ) ; } String oldApp = appIdMap . putIfAbsent ( application , appName ) ; if ( oldApp != null && ! oldApp . equals ( appName ) ) { throw new AppIDInUseException ( application , oldApp , appName ) ; } }
a lame attempt to prevent duplicate application id . todo : we should expose appid - > appname map via rest api so cli doesn ' t need a separate copy of the map .
