RFR: JDK-8325743: test/jdk/java/nio/channels/unixdomain/SocketOptions.java enhance user name output in error case [v2]

Matthias Baesken mbaesken at openjdk.org
Tue Feb 13 15:08:09 UTC 2024


On Tue, 13 Feb 2024 14:25:03 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Since this is a test the proposed changes look reasonable to me. @Michael-Mc-Mahon may have more comments. You may want to consider adding a line break to avoid long lines.

Btw. in some other places we happily print the user name/id in the exception (but indeed this is test code so it should be no issue).
https://github.com/openjdk/jdk/blame/master/src/java.base/unix/classes/sun/nio/fs/UnixUserPrincipals.java#L144

leads to (test injdk21u-dev), the user name seems no we messed up because of the bad LDAP we had on the test system, that's why only the id shows up in the exception
java.io.IOException: 3199: 
	at java.base/sun.nio.fs.UnixUserPrincipals.lookupName(UnixUserPrincipals.java:145)
	at java.base/sun.nio.fs.UnixUserPrincipals.lookupUser(UnixUserPrincipals.java:167)
	at java.base/sun.nio.fs.UnixFileSystem$LookupService$1.lookupPrincipalByName(UnixFileSystem.java:361)
	at CheckPermissions.main(CheckPermissions.java:775)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1583)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17829#issuecomment-1941715306


More information about the nio-dev mailing list