gnodet commented on issue #11582: URL: https://github.com/apache/maven/issues/11582#issuecomment-5532096788
And for completeness, the same survey for JDK 8–12 — every new immutable type/interface introduced in this range, checking both accessor styles: **Noun-style accessors (no `get` prefix):** - **Java 8** — `Collector`: `supplier()`, `accumulator()`, `combiner()`, `finisher()`, `characteristics()` - **Java 9** — `ModuleDescriptor`: `name()`, `version()`, `requires()`, `exports()`, `opens()`, `uses()`, `provides()`, `packages()`, `modifiers()` - **Java 9** — `ModuleDescriptor.Exports`: `source()`, `targets()`, `modifiers()` - **Java 9** — `ModuleDescriptor.Requires`: `name()`, `modifiers()`, `compiledVersion()` - **Java 9** — `ModuleDescriptor.Provides`: `service()`, `providers()` - **Java 9** — `ModuleReference`: `descriptor()`, `location()` - **Java 9** — `ProcessHandle`: `pid()`, `info()`, `parent()`, `children()` - **Java 9** — `ProcessHandle.Info`: `command()`, `arguments()`, `user()`, `startInstant()`, `totalCpuDuration()`, `commandLine()` - **Java 9** — `ServiceLoader.Provider`: `type()` - **Java 11** — `HttpClient`: `authenticator()`, `connectTimeout()`, `cookieHandler()`, `executor()`, `followRedirects()`, `proxy()`, `sslContext()`, `sslParameters()`, `version()` - **Java 11** — `HttpRequest`: `method()`, `uri()`, `headers()`, `bodyPublisher()`, `expectContinue()`, `timeout()`, `version()` - **Java 11** — `HttpResponse`: `statusCode()`, `body()`, `headers()`, `uri()`, `version()` - **Java 12** — `ClassDesc`: `packageName()`, `displayName()` - **Java 12** — `MethodTypeDesc`: `returnType()`, `parameterCount()`, `parameterList()`, `parameterArray()` - **Java 12** — `DirectMethodHandleDesc`: `kind()`, `methodName()`, `owner()`, `lookupDescriptor()`, `refKind()` - **Java 12** — `DynamicConstantDesc`: `bootstrapArgs()`, `bootstrapMethod()`, `constantName()`, `constantType()` **`getX()`-style accessors on newly introduced immutable types:** - **Java 9** — `StackWalker.StackFrame`: `getClassName()`, `getMethodName()`, `getFileName()`, `getLineNumber()`, `getByteCodeIndex()` — however, this interface was deliberately designed to mirror `StackTraceElement` (Java 1.4), and even provides a `toStackTraceElement()` conversion method. The naming follows the pre-existing class it mirrors. So across the entire JDK 8–25 range, the only two counter-examples are `StackWalker.StackFrame` (mirrors `StackTraceElement` from Java 1.4) and `UnixDomainSocketAddress` (extends `SocketAddress` from Java 1.4). Both are constrained by pre-existing APIs. Every genuinely new immutable type — unconstrained by legacy — uses noun-style accessors. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
