Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349072 - [1.7] "Cannot infer elided type(s)" sounds too elite
Summary: [1.7] "Cannot infer elided type(s)" sounds too elite
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 trivial (vote)
Target Milestone: 3.7.1   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-10 12:27 EDT by Markus Keller CLA
Modified: 2011-08-05 02:54 EDT (History)
4 users (show)

See Also:


Attachments
Proposed patch (9.35 KB, patch)
2011-06-13 08:34 EDT, Srikanth Sankaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.