[ 
https://issues.apache.org/jira/browse/FLINK-17530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17100540#comment-17100540
 ] 

Chesnay Schepler commented on FLINK-17530:
------------------------------------------

Ignoring classes is no solution since there could be a ton of other classes 
that are affected, maybe also user-code at some point. The thing to remember 
with reflective access warning is that they only show the first one that 
occurred, by default.

Now that we have the BashJavaUtils it _may_ be easier to detect whether you're 
running on Java 8/11+, but I'm still not super hot on the add-opens approach.
All we're doing is hiding the warning; the underlying problem of the 
ClosureCleaner doing stuff that it (now) shouldn't be doing still remains.
So maybe we should just bite the bullet and either stop using it or rework it 
in some other way.

> Fix illegal reflective access by ClosureCleaner
> -----------------------------------------------
>
>                 Key: FLINK-17530
>                 URL: https://issues.apache.org/jira/browse/FLINK-17530
>             Project: Flink
>          Issue Type: Sub-task
>          Components: API / DataStream
>    Affects Versions: 1.11.0
>            Reporter: Robert Metzger
>            Assignee: Robert Metzger
>            Priority: Major
>             Fix For: 1.11.0
>
>
> To reproduce:
> {code}
>       @Test
>       public void testJava11Warning() {
>               MapFunction<String, String> fun = new MapFunction<String, 
> String>() {
>                       String field = "asdf";
>                       @Override
>                       public String map(String value) throws Exception {
>                               return value + field;
>                       }
>               };
>               ClosureCleaner.clean(fun, 
> ExecutionConfig.ClosureCleanerLevel.RECURSIVE, false);
>       }
> {code}
> Causes:
> {code}
> WARNING: Illegal reflective access by 
> org.apache.flink.api.java.ClosureCleaner 
> (file:/Users/robert/Projects/flink/flink-core/target/classes/) to field 
> java.lang.String.value
>       at 
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:104)
>       at 
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>       at 
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:71)
>       at 
> org.apache.flink.api.java.ClosureCleanerTest.testJava11Warning(ClosureCleanerTest.java:58)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to