addColumn: bad return type in lambda expression

Hi

this is my first webapp with vaadin. Had a great time so far - it’s a great way to develop web application without th hazle of Html/Javascript.

Currently i’ve struggling with a lamda expression while adding a column to my grid.

My Code looks like that:

The Grid:

TemplateRenderer<Account> r = TemplateRenderer.of("<iron-icon icon=\"vaadin:circle\" class-name=\"[[item.v]
]\"></iron-icon> [[item.v]
]");
addColumn(r.withProperty("v",account -> account.getValue()));

The Account Pojo:

@Entity
public class Account implements Serializable {

	private String value;
	public String getValue() {
		return value;
	}
	...
}

During the compile i get the exception:

AccountGrid.java:[30,65]
 incompatible types: bad return type in lambda expression 
	java.lang.String cannot be converted to ?

The weired thing: During the build with eclipse (maven plugin) the error occurs not every time. During the build with maven on the command line the error keeps remaining…

Would be great if you can shed some light on this issue

Kind regards
Michael

Your code example seems to work for me without compilation problems. I also cannot spot anything that would look suspicious in your code. Based on that, my best guess is something along the lines of a bug in the specific version of Java that you’re using. You could try updating to the newest version and see if that would help fix the problem.

Okay thank you for the information. Switching the VM is not possible that easy because it’s used for other services on the target machine.

I removed the lambda expressions and doing it “old style” then it’s working

TemplateRenderer<Account> r = TemplateRenderer.<Account>of("<iron-icon icon=\"vaadin:circle\" class-name=\"[[item.v]
]\"></iron-icon> [[item.v]
]")
        .withProperty("v", new ValueProvider<Account, String>() {
			@Override
			public String apply(Account a) {
				return a.getValue();
			}
		});