Skip to content

Commit 5d944c7

Browse files
committed
Minor cleanups
Signed-off-by: David Matějček <[email protected]>
1 parent 096ace2 commit 5d944c7

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

appserver/itest-tools/src/main/java/org/glassfish/main/itest/tools/GlassFishTestEnvironment.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ private static File findStartServ(String... optionalPrefix) {
371371
return new File(GF_ROOT, isWindows() ? prefix + "bin/startserv.bat" : prefix + "bin/startserv");
372372
}
373373

374-
private static File findKeyTool() {
375-
return new File(System.getProperty(JAVA_HOME.getSystemPropertyName()), isWindows() ? "bin/keytool.exe" : "bin/keytool");
376-
}
377-
378374
private static File findJarSigner() {
379375
return new File(System.getProperty(JAVA_HOME.getSystemPropertyName()), isWindows() ? "bin/jarsigner.exe" : "bin/jarsigner");
380376
}

appserver/tests/application/src/test/java/org/glassfish/main/test/app/synchronize/SynchronizeStandaloneInstanceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ private static File createDeployment() {
8989
webArchive.as(ZipExporter.class).exportTo(warFile, true);
9090
return warFile;
9191
}
92-
}
92+
}

appserver/tests/quicklook/adminconsole/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,5 @@
9898
<version>3.1</version>
9999
<scope>compile</scope>
100100
</dependency>
101-
<dependency>
102-
<groupId>org.glassfish.common</groupId>
103-
<artifactId>amx-core</artifactId>
104-
<version>7.1.0-SNAPSHOT</version>
105-
</dependency>
106101
</dependencies>
107102
</project>

nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/KeystoreManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected void createKeyStore(File keyStore, RepositoryConfig config, String mas
100100
}
101101

102102

103-
protected void copyCertificatesToTrustStore(File configRoot, DomainConfig config, String masterPassword)
103+
protected final void copyCertificatesToTrustStore(File configRoot, DomainConfig config, String masterPassword)
104104
throws DomainException {
105105
final File keyStore = new File(configRoot, KEYSTORE_FILENAME_DEFAULT);
106106
final File trustStore = new File(configRoot, TRUSTSTORE_FILENAME_DEFAULT);

nucleus/security/services/src/main/java/org/glassfish/security/services/impl/JCEKSPasswordAliasStore.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation.
23
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
@@ -13,15 +14,13 @@
1314
*
1415
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1516
*/
16-
1717
package org.glassfish.security.services.impl;
1818

1919
import com.sun.enterprise.security.store.PasswordAdapter;
2020
import com.sun.enterprise.util.Utility;
2121

2222
import java.nio.ByteBuffer;
2323
import java.nio.CharBuffer;
24-
import java.nio.charset.Charset;
2524
import java.util.ArrayList;
2625
import java.util.Enumeration;
2726
import java.util.HashMap;
@@ -33,6 +32,8 @@
3332

3433
import org.glassfish.api.admin.PasswordAliasStore;
3534

35+
import static java.nio.charset.StandardCharsets.UTF_8;
36+
3637
/**
3738
* Provides the PasswordAliasStore behavior using a JCEKS keystore.
3839
* <p>
@@ -59,9 +60,7 @@
5960
*/
6061
public class JCEKSPasswordAliasStore implements PasswordAliasStore {
6162

62-
private final static Charset utf8 = Charset.forName("UTF-8");
63-
64-
private PasswordAdapter pa = null;
63+
private PasswordAdapter pa;
6564
private String pathToAliasStore;
6665
private char[] storePassword;
6766

@@ -101,7 +100,7 @@ public void clear() {
101100
@Override
102101
public void put(String alias, char[] password) {
103102
final CharBuffer charBuffer = CharBuffer.wrap(password);
104-
final ByteBuffer byteBuffer = utf8.encode(charBuffer);
103+
final ByteBuffer byteBuffer = UTF_8.encode(charBuffer);
105104
try {
106105
pa().setPasswordForAlias(alias, Utility.toByteArray(byteBuffer));
107106
} catch (Exception ex) {
@@ -150,7 +149,7 @@ public char[] get(String alias) {
150149
try {
151150
final SecretKey secretKey = pa().getPasswordSecretKeyForAlias(alias);
152151
final ByteBuffer byteBuffer = ByteBuffer.wrap(secretKey.getEncoded());
153-
return Utility.toCharArray(utf8.decode(byteBuffer));
152+
return Utility.toCharArray(UTF_8.decode(byteBuffer));
154153
} catch (Exception ex) {
155154
throw new RuntimeException(ex);
156155
}

0 commit comments

Comments
 (0)