# HG changeset patch # User herrick # Date 1555080850 14400 # Node ID 66c1dbc008c578569a9b2d2acad367836d038c24 # Parent 5a5e00cc993200048fd54239ff9663b1775e9086 8217895: jpackage --identifer purpose Reviewed-by: almatvee diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Fri Apr 12 10:54:10 2019 -0400 @@ -187,7 +187,6 @@ JAVA_OPTIONS, MAIN_CLASS, MAIN_JAR, - PREFERENCES_ID, VERSION, VERBOSE ); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp --- a/src/jdk.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -151,11 +151,7 @@ return NULL; } - if (result->LoadFromFile(FileName) == false) { - // New property file format was not found, - // attempt to load old property file format. - Helpers::LoadOldConfigFile(FileName, result); - } + result->LoadFromFile(FileName); return result; } diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Fri Apr 12 10:54:10 2019 -0400 @@ -361,7 +361,6 @@ MAC_CF_BUNDLE_VERSION, MAIN_CLASS, MAIN_JAR, - PREFERENCES_ID, SIGNING_KEYCHAIN, VERSION, VERBOSE diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Fri Apr 12 10:54:10 2019 -0400 @@ -524,9 +524,6 @@ StandardBundlerParam.MODULE.fetchFrom(params)); } - data.put("DEPLOY_PREFERENCES_ID", - PREFERENCES_ID.fetchFrom(params).toLowerCase()); - StringBuilder sb = new StringBuilder(); List jvmOptions = JAVA_OPTIONS.fetchFrom(params); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Info.plist.template --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Info.plist.template Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Info.plist.template Fri Apr 12 10:54:10 2019 -0400 @@ -40,8 +40,6 @@ DEPLOY_APP_CLASSPATH JavaMainJarName DEPLOY_MAIN_JAR_NAME - JavaPreferencesID - DEPLOY_PREFERENCES_ID JavaOptions DEPLOY_JAVA_OPTIONS diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm --- a/src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm Fri Apr 12 10:54:10 2019 -0400 @@ -394,11 +394,7 @@ } if (UsePListForConfigFile() == false) { - if (result->LoadFromFile(FileName) == false) { - // New property file format was not found, - // attempt to load old property file format. - Helpers::LoadOldConfigFile(FileName, result); - } + result->LoadFromFile(FileName); } else { NSBundle *mainBundle = [NSBundle mainBundle]; NSDictionary *infoDictionary = [mainBundle infoDictionary]; @@ -480,8 +476,6 @@ CONFIG_CLASSPATH_KEY, _T("JavaAppClasspath"))); keys.insert(std::map::value_type(APP_NAME_KEY, _T("CFBundleName"))); - keys.insert(std::map::value_type(CONFIG_APP_ID_KEY, - _T("JavaPreferencesID"))); keys.insert(std::map::value_type(JAVA_RUNTIME_KEY, _T("JavaRuntime"))); keys.insert(std::map::value_type(JPACKAGE_APP_DATA_DIR, diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Fri Apr 12 10:54:10 2019 -0400 @@ -197,7 +197,6 @@ out.println("[Application]"); out.println("app.name=" + APP_NAME.fetchFrom(params)); out.println("app.version=" + VERSION.fetchFrom(params)); - out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params)); out.println("app.runtime=" + runtimeLocation); out.println("app.identifier=" + IDENTIFIER.fetchFrom(params)); out.println("app.classpath=" + String.join(File.pathSeparator, diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Fri Apr 12 10:54:10 2019 -0400 @@ -177,10 +177,6 @@ return fetchParam(IDENTIFIER); } - public String getPreferencesID() { - return fetchParam(PREFERENCES_ID); - } - public String getApplicationClass() { return fetchParam(MAIN_CLASS); } @@ -282,14 +278,6 @@ putUnlessNull(PARAM_COPYRIGHT, c); } - public String getIdentifier() { - return fetchParam(IDENTIFIER); - } - - public void setIdentifier(String s) { - putUnlessNull(PARAM_IDENTIFIER, s); - } - private String mainJar = null; // assuming that application was packaged according to the rules diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Fri Apr 12 10:54:10 2019 -0400 @@ -486,8 +486,6 @@ // construct app resources relative to output folder! bundleParams.setAppResourcesList(resources); - bundleParams.setIdentifier(id); - bundleParams.setApplicationClass(applicationClass); bundleParams.setAppVersion(version); bundleParams.setType(bundleType); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Fri Apr 12 10:54:10 2019 -0400 @@ -315,15 +315,6 @@ (s, p) -> s ); - static final StandardBundlerParam PREFERENCES_ID = - new StandardBundlerParam<>( - "preferencesID", - String.class, - p -> Optional.ofNullable(IDENTIFIER.fetchFrom(p)). - orElse("").replace('.', '/'), - (s, p) -> s - ); - static final StandardBundlerParam VERBOSE = new StandardBundlerParam<>( Arguments.CLIOptions.VERBOSE.getId(), diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Fri Apr 12 10:54:10 2019 -0400 @@ -164,9 +164,9 @@ \ The keys "extension", "mime-type", "icon", and "description"\n\ \ can be used to describe the association.\n\ \ --identifier \n\ -\ Machine readable identifier of the application\n\ -\ The format must be a DNS name in reverse order,\n\ -\ such as com.example.myapplication.\n\ +\ An identifier that uniquely identifies the application\n\ +\ Defaults to the main class name.\n\ +\ The value should be a valid DNS name.\n\ \ --install-dir \n\ \ {4}\ \ --installer-type \n\ @@ -223,7 +223,7 @@ MSG_Help_mac_launcher=\ \ --mac-bundle-identifier \n\ \ An identifier that uniquely identifies the application for MacOSX\n\ -\ (and on the Mac App Store)\n\ +\ Defaults to the value of --identifier option.\n\ \ May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),\n\ \ and period (.) characters.\n\ \ --mac-bundle-name \n\ diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Fri Apr 12 10:54:10 2019 -0400 @@ -164,9 +164,9 @@ \ The keys "extension", "mime-type", "icon", and "description"\n\ \ can be used to describe the association.\n\ \ --identifier \n\ -\ Machine readable identifier of the application\n\ -\ The format must be a DNS name in reverse order,\n\ -\ such as com.example.myapplication.\n\ +\ An identifier that uniquely identifies the application\n\ +\ Defaults to the main class name.\n\ +\ The value should be a valid DNS name.\n\ \ --install-dir \n\ \ {4}\ \ --installer-type \n\ @@ -223,7 +223,7 @@ MSG_Help_mac_launcher=\ \ --mac-bundle-identifier \n\ \ An identifier that uniquely identifies the application for MacOSX\n\ -\ (and on the Mac App Store)\n\ +\ Defaults to the value of --identifier option.\n\ \ May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),\n\ \ and period (.) characters.\n\ \ --mac-bundle-name \n\ diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Fri Apr 12 10:54:10 2019 -0400 @@ -164,9 +164,9 @@ \ The keys "extension", "mime-type", "icon", and "description"\n\ \ can be used to describe the association.\n\ \ --identifier \n\ -\ Machine readable identifier of the application\n\ -\ The format must be a DNS name in reverse order,\n\ -\ such as com.example.myapplication.\n\ +\ An identifier that uniquely identifies the application\n\ +\ Defaults to the main class name.\n\ +\ The value should be a valid DNS name.\n\ \ --install-dir \n\ \ {4}\ \ --installer-type \n\ @@ -223,7 +223,7 @@ MSG_Help_mac_launcher=\ \ --mac-bundle-identifier \n\ \ An identifier that uniquely identifies the application for MacOSX\n\ -\ (and on the Mac App Store)\n\ +\ Defaults to the value of --identifier option.\n\ \ May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),\n\ \ and period (.) characters.\n\ \ --mac-bundle-name \n\ diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Helpers.cpp --- a/src/jdk.jpackage/share/native/libapplauncher/Helpers.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Helpers.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -167,62 +167,6 @@ return result; } -void AppendToIni(PropertyFile &Source, IniFile* Destination, TString Key) { - TString value; - - if (Source.GetValue(Key, value) == true) { - Platform& platform = Platform::GetInstance(); - std::map keys = platform.GetKeys(); - Destination->Append(keys[CONFIG_SECTION_APPLICATION], Key, value); - } -} - -void Helpers::LoadOldConfigFile(TString FileName, IniFile* Container) { - PropertyFile propertyFile; - - if (propertyFile.LoadFromFile(FileName) == true) { - Platform& platform = Platform::GetInstance(); - - std::map keys = platform.GetKeys(); - - // Application Section - AppendToIni(propertyFile, Container, keys[CONFIG_MAINJAR_KEY]); - AppendToIni(propertyFile, Container, keys[CONFIG_MAINMODULE_KEY]); - AppendToIni(propertyFile, Container, keys[CONFIG_MAINCLASSNAME_KEY]); - AppendToIni(propertyFile, Container, keys[CONFIG_CLASSPATH_KEY]); - AppendToIni(propertyFile, Container, keys[APP_NAME_KEY]); - AppendToIni(propertyFile, Container, keys[CONFIG_APP_ID_KEY]); - AppendToIni(propertyFile, Container, keys[JAVA_RUNTIME_KEY]); - AppendToIni(propertyFile, Container, keys[JPACKAGE_APP_DATA_DIR]); - - AppendToIni(propertyFile, Container, keys[CONFIG_APP_MEMORY]); - AppendToIni(propertyFile, Container, keys[CONFIG_SPLASH_KEY]); - - // JavaOptions Section - OrderedMap JavaOptions = - Helpers::GetJavaOptionsFromConfig(&propertyFile); - Container->AppendSection(keys[CONFIG_SECTION_JAVAOPTIONS], JavaOptions); - - // ArgOptions Section - std::list args = Helpers::GetArgsFromConfig(&propertyFile); - OrderedMap convertedArgs; - - for (std::list::iterator iterator = args.begin(); - iterator != args.end(); iterator++) { - TString arg = *iterator; - TString name; - TString value; - - if (Helpers::SplitOptionIntoNameValue(arg, name, value) == true) { - convertedArgs.Append(name, value); - } - } - - Container->AppendSection(keys[CONFIG_SECTION_ARGOPTIONS], - convertedArgs); - } -} - std::list Helpers::MapToNameValueList(OrderedMap Map) { std::list result; diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Helpers.h --- a/src/jdk.jpackage/share/native/libapplauncher/Helpers.h Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Helpers.h Fri Apr 12 10:54:10 2019 -0400 @@ -55,8 +55,6 @@ GetJavaOptionsFromConfig(IPropertyContainer* config); static std::list GetArgsFromConfig(IPropertyContainer* config); - static void LoadOldConfigFile(TString FileName, IniFile* Container); - static std::list MapToNameValueList(OrderedMap Map); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/JavaVirtualMachine.cpp --- a/src/jdk.jpackage/share/native/libapplauncher/JavaVirtualMachine.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/JavaVirtualMachine.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -158,7 +158,6 @@ + package.GetPackageLauncherDirectory()); options.AppendValue( _T("-Djava.launcher.path"), package.GetPackageLauncherDirectory()); - options.AppendValue(_T("-Dapp.preferences.id"), package.GetAppID()); options.AppendValues(package.GetJavaOptions()); #ifdef DEBUG diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Package.cpp --- a/src/jdk.jpackage/share/native/libapplauncher/Package.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Package.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -71,8 +71,6 @@ platform.GetConfigFile(platform.GetConfigFileName()); config->GetValue(keys[CONFIG_SECTION_APPLICATION], - keys[CONFIG_APP_ID_KEY], FBootFields->FAppID); - config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[JPACKAGE_APP_DATA_DIR], FBootFields->FPackageAppDataDirectory); FBootFields->FPackageAppDataDirectory = FilePath::FixPathForPlatform(FBootFields->FPackageAppDataDirectory); @@ -479,11 +477,6 @@ return FBootFields->FAppCDSCacheFileName; } -TString Package::GetAppID() { - assert(FBootFields != NULL); - return FBootFields->FAppID; -} - TString Package::GetPackageAppDataDirectory() { assert(FBootFields != NULL); return FBootFields->FPackageAppDataDirectory; diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Package.h --- a/src/jdk.jpackage/share/native/libapplauncher/Package.h Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Package.h Fri Apr 12 10:54:10 2019 -0400 @@ -47,7 +47,6 @@ TString FPackageAppDirectory; TString FPackageLauncherDirectory; TString FAppDataDirectory; - TString FAppID; TString FPackageAppDataDirectory; TString FClassPath; TString FModulePath; @@ -108,7 +107,6 @@ TString GetAppCDSCacheDirectory(); TString GetAppCDSCacheFileName(); - TString GetAppID(); TString GetPackageAppDataDirectory(); TString GetClassPath(); TString GetModulePath(); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Platform.cpp --- a/src/jdk.jpackage/share/native/libapplauncher/Platform.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Platform.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -140,8 +140,6 @@ _T("app.modulepath"))); keys.insert(std::map::value_type(APP_NAME_KEY, _T("app.name"))); - keys.insert(std::map::value_type(CONFIG_APP_ID_KEY, - _T("app.preferences.id"))); keys.insert(std::map::value_type(JAVA_RUNTIME_KEY, _T("app.runtime"))); keys.insert(std::map::value_type(JPACKAGE_APP_DATA_DIR, diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/share/native/libapplauncher/Platform.h --- a/src/jdk.jpackage/share/native/libapplauncher/Platform.h Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/share/native/libapplauncher/Platform.h Fri Apr 12 10:54:10 2019 -0400 @@ -59,7 +59,6 @@ #define CONFIG_MODULEPATH_KEY _T("CONFIG_MODULEPATH_KEY") #define APP_NAME_KEY _T("APP_NAME_KEY") #define CONFIG_SPLASH_KEY _T("CONFIG_SPLASH_KEY") -#define CONFIG_APP_ID_KEY _T("CONFIG_APP_ID_KEY") #define CONFIG_APP_MEMORY _T("CONFIG_APP_MEMORY") #define CONFIG_APP_DEBUG _T("CONFIG_APP_DEBUG") #define CONFIG_APPLICATION_INSTANCE _T("CONFIG_APPLICATION_INSTANCE") diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Fri Apr 12 10:54:10 2019 -0400 @@ -234,7 +234,6 @@ JAVA_OPTIONS, MAIN_CLASS, MAIN_JAR, - PREFERENCES_ID, VERSION, VERBOSE ); diff -r 5a5e00cc9932 -r 66c1dbc008c5 src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp --- a/src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp Thu Apr 11 07:44:51 2019 -0400 +++ b/src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp Fri Apr 12 10:54:10 2019 -0400 @@ -239,11 +239,7 @@ return NULL; } - if (result->LoadFromFile(FileName) == false) { - // New property file format was not found, - // attempt to load old property file format. - Helpers::LoadOldConfigFile(FileName, result); - } + result->LoadFromFile(FileName); return result; }