A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2783 below:

[java] Error while parsing with lambda of custom interface · Issue #2783 · pmd/pmd · GitHub

Affects PMD Version: 6.21.0

Description:

A PMDException occurs with the message "Error while parsing ..."
The code sample below can be used to reproduce the issue. I have reduced the code as much as possible.
Further changes will make the error go away, such as

Maybe this helps when analyzing the issue.

Code Sample demonstrating the issue:

import java.util.List;

public class PMDError {

  public Spec<String> test() {
    return (Spec<String>) (a, b) -> {
      return a.toArray(String[]::new);
    };
  }

  public interface Spec<T> {
    String[] process(List<T> var1, List<?> var2);
  }
}

Steps to reproduce:

  1. ... running pmd:check using the maven-pmd-plugin on the above code
  2. ... A warning is printed on the console with the PMDException message

Running PMD through: Maven


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4