LuciferYang commented on PR #43796:
URL: https://github.com/apache/spark/pull/43796#issuecomment-1811951525
> This is a nice syntax in general, @LuciferYang .
>
> However, we cannot use this when the class provides information hiding.
>
> ```java
> jshell> private static class FieldAccessor { private final String field;
FieldAccessor(String field) { this.field = field; } }
> | created class FieldAccessor
>
> jshell> var a = new FieldAccessor("secret")
> a ==> FieldAccessor@12edcd21
>
> jshell> a.field
> | Error:
> | field has private access in FieldAccessor
> | a.field
> | ^-----^
>
> jshell> private record FieldAccessor2(String field) {}
> | created record FieldAccessor2
>
> jshell> var b = new FieldAccessor2("secret")
> b ==> FieldAccessor2[field=secret]
>
> jshell> b.field()
> $5 ==> "secret"
> ```
>
> Could you remove all changes like the above?
OK, let me double check this
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]