Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349072

Summary: [1.7] "Cannot infer elided type(s)" sounds too elite
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: amj87.iitr, deepakazad, Olivier_Thomann, satyam.kandula
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Markus Keller CLA 2011-06-10 12:27:36 EDT
BETA_JAVA7

import java.util.ArrayList;
import java.util.List;

public class DiamondErr2 {
	List<?> m() {
		return new ArrayList<>("");
	}
}

The error message "Cannot infer elided type(s)" should be expressed with simpler words, e.g. "Cannot infer type arguments". We also avoid the plural (s) in parentheses. In places where duplicating all messages is overkill, just use the plural (like most compiler messages already do).

Olivier, I think the readability of the spec would also improve if the word "elide" would be replaced by "omit" (which is generally used in JLS3).
Comment 1 Olivier Thomann CLA 2011-06-10 12:56:17 EDT
I think it is too late to change "elide" to "omit". I'll ask anyway.
Right now the error message is matching the wording used in the specification for diamond.
Note that javac is reporting:
error: cannot infer type arguments for ArrayList<>

which is closer to what you request.
Comment 2 Srikanth Sankaran CLA 2011-06-13 08:34:26 EDT
Created attachment 197883 [details]
Proposed patch

I'll ignore for the moment the point that java itself is fast
becoming elitist so much so that only mathematicians will be
using certain parts of the language (and will be furiously
debating, using the most arcane of arguments, the validity or
lack of a disputed code snippet) :)

We now use "Cannot infer type arguments for {0}"

For the record there are a few messages using the (s) style
of ambiguous pluralism, but I changed the current message
anyways.
Comment 3 Srikanth Sankaran CLA 2011-06-13 10:52:22 EDT
Released in BETA_JAVA7 branch.
Comment 4 Satyam Kandula CLA 2011-07-01 00:58:16 EDT
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.