Reputation: 1546
When I want to open the Design tab in Eclipse, I get this error: Anonymous class creation can not be evaluated.
In general case it is impossible to evaluate creation of anonymous class. So, expression ...
new AbstractFormatterFactory() {
@Override public AbstractFormatter getFormatter(JFormattedTextField tf) {
NumberFormat format = DecimalFormat.getInstance();
format.setMinimumFractionDigits(2);
format.setMaximumFractionDigits(2);
format.setRoundingMode(RoundingMode.HALF_UP);
InternationalFormatter formatter = new InternationalFormatter(format);
formatter.setAllowsInvalid(false);
formatter.setMinimum(0.0);
return formatter;
}
}
... was not evaluated.
The problem is in this block:
final JFormattedTextField textField1 = new JFormattedTextField(new Float(10.01));
textField1.setFormatterFactory(new AbstractFormatterFactory() {
@Override
public AbstractFormatter getFormatter(JFormattedTextField tf) {
NumberFormat format = DecimalFormat.getInstance();
format.setMinimumFractionDigits(2);
format.setMaximumFractionDigits(2);
format.setRoundingMode(RoundingMode.HALF_UP);
InternationalFormatter formatter = new InternationalFormatter(format);
formatter.setAllowsInvalid(false);
formatter.setMinimum(0.0);
return formatter;
}
});
How can I solve this anonymous class thing?
Upvotes: 0
Views: 1323
Reputation: 533492
What is this warning stopping you from doing other then viewing it in a Design tool?
If it is causing a concern it will be due to a random bug in the plugin.
To work out the likely cause, comment out the whole function, test it is okay not and add back the method a line at a time to see when breaks the plugin.
Upvotes: 1