[ 
https://issues.apache.org/jira/browse/BEAM-6096?focusedWorklogId=167621&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-167621
 ]

ASF GitHub Bot logged work on BEAM-6096:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Nov/18 04:56
            Start Date: 20/Nov/18 04:56
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on a change in pull request 
#7085: [BEAM-6096] illegal signature attribute when compiling with JDK 11
URL: https://github.com/apache/beam/pull/7085#discussion_r234869134
 
 

 ##########
 File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/WindowMergingFnRunner.java
 ##########
 @@ -130,16 +130,16 @@ private MergingViaWindowFnRunner(WindowFn<?, W> 
windowFn) {
       this.mergedWindows = new ArrayList<>();
       this.currentWindows = new ArrayList<>();
       this.mergeContext =
-          windowFn.new MergeContext() {
+          ((WindowFn) windowFn).new MergeContext() {
 
 Review comment:
   I meant whether it was, in fact, legitimate to treat it as `WindowFn<T, W>`. 
I believe the intent of the wildcard is probably to acknowledge that the type 
is unknown. So changing `?` to `Object` would probably work fine and have fewer 
casts and no rawtypes.
   
   Sorry for the nitpicking, just trying to avoid rawtypes. IMO only for 
compatibility with pre-generics code or extremely special cases where Java's 
type system can't handle it. Ideally we'd `-Werror` on rawtypes.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 167621)
    Time Spent: 50m  (was: 40m)

> illegal signature attribute when compiling with JDK 11
> ------------------------------------------------------
>
>                 Key: BEAM-6096
>                 URL: https://issues.apache.org/jira/browse/BEAM-6096
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-core
>            Reporter: Liam Miller-Cushon
>            Assignee: Liam Miller-Cushon
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The following code is invalid, and fails to compile with the JDK 11 javac: 
> https://github.com/apache/beam/blob/1cbbc4d8755130f137e7d9ef4813e8d3b917cb70/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/WindowMergingFnRunner.java#L132-L144
> The error is:
> ```
> error: error while generating class <anonymous 
> org.apache.beam.fn.harness.WindowMergingFnRunner$MergingViaWindowFnRunner$1>
>  (illegal signature attribute for type CAP#1)
>  where CAP#1 is a fresh type-variable:
>  CAP#1 extends Object from capture of ?
> ```
> The code was previously accepted by javac due to a bug, which has been fixed 
> in JDK 11: https://bugs.openjdk.java.net/browse/JDK-8203436



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to