Skip to content

Commit 62fce74

Browse files
committed
U refactoring
1 parent e6b447a commit 62fce74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/io/github/fvarrui/javapackager/packagers/BundleJre.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ protected File doApply(Packager packager) throws Exception {
4444
List<String> requiredModules = packager.getModules();
4545
List<String> additionalModules = packager.getAdditionalModules();
4646
List<File> additionalModulePaths = packager.getAdditionalModulePaths();
47-
4847
File currentJdk = packager.getPackagingJdk();
4948

5049
Logger.infoIndent("Bundling JRE ... with " + currentJdk);
@@ -111,7 +110,7 @@ protected File doApply(Packager packager) throws Exception {
111110
throw new Exception("Invalid JDK for platform '" + platform + "': " + jdkPath);
112111
}
113112

114-
String modules = getRequiredModules(packager, libsFolder, customizedJre, jarFile, requiredModules, additionalModules, additionalModulePaths);
113+
String modules = getRequiredModules(currentJdk, libsFolder, customizedJre, jarFile, requiredModules, additionalModules, additionalModulePaths);
115114

116115
Logger.info("Creating JRE with next modules included: " + modules);
117116

@@ -124,7 +123,7 @@ protected File doApply(Packager packager) throws Exception {
124123

125124
if (destinationFolder.exists()) FileUtils.removeFolder(destinationFolder);
126125

127-
String jlink = new File(currentJdk, "/bin/jlink").getAbsolutePath();
126+
File jlink = new File(currentJdk, "/bin/jlink");
128127

129128
// generates customized jre using modules
130129
CommandUtils.execute(
@@ -182,11 +181,11 @@ protected File doApply(Packager packager) throws Exception {
182181
* @return string containing a comma separated list with all needed modules
183182
* @throws Exception Process failed
184183
*/
185-
protected String getRequiredModules(Packager packager, File libsFolder, boolean customizedJre, File jarFile, List<String> defaultModules, List<String> additionalModules, List<File> additionalModulePaths) throws Exception {
184+
protected String getRequiredModules(File packagingJdk, File libsFolder, boolean customizedJre, File jarFile, List<String> defaultModules, List<String> additionalModules, List<File> additionalModulePaths) throws Exception {
186185

187186
Logger.infoIndent("Getting required modules ... ");
188187

189-
File jdeps = new File(packager.getPackagingJdk(), "/bin/jdeps");
188+
File jdeps = new File(packagingJdk, "/bin/jdeps");
190189

191190
File jarLibs = null;
192191
if (libsFolder != null && libsFolder.exists())

0 commit comments

Comments
 (0)