Community
Participate
Working Groups
Message: "Null pointer access: The variable x can only be null at this location" This sentence sounds as if Eclipse must have the variable set to null. I would rephrase to this: "Null pointer access: The variable x is always null at this location" PS: Any other sentences using "can" ?
(In reply to comment #0) > Message: "Null pointer access: The variable x can only be null at this > location" > > This sentence sounds as if Eclipse must have the variable set to null. IMO, the existing message is clear enough. This is a fairly long standing diagnostic and we have not heard complaints so far.
I don't know how many complaints you'll get on this due the triviality. A developer is surely able to figure out the message. However, since Eclipse is stating a fact, the use of "is" over "can" should be preferred. The former is measures clearer than the latter because "can" can imply optionality or a permission based on your background.
I think in combinations as "can only" and "cannot" the statement is already strong enough. OTOH, looking at all 131 compiler messages using "can" or "cannot" the vast majority speaks about things which a programmer is not allowed to write, e.g.: "The final field {0}.{1} cannot be assigned" Compare this to "The variable {0} cannot be null at this location" The semantics of both sentences is indeed different, a difference that is blurred by the similar wording. I could see that this slightly confuses a user. I wouldn't generally mind changing: can only be null -> is always null cannot be null -> is never null All other uses seem to fall into one of these: - what can or cannot be written as a legal Java program - "cannot be resolved" ... but I'm not an English linguist BTW: I'm surprised nobody ever complained about a variable "being" null or not null. We're actually cheating about the difference between a variable and the bound value, but I guess in this matter simplicity trumps dotting the last i for correctness :)
Thanks for everyone's feedback. I asked my coworker, who has a BS in Writing and MA in English Literature, to look at this ticket and give his opinion. He responded: "My suggestion: 'X is null always at this location.' That's intuitive, and according to Malcom Forbes keep nouns and verbs close for easy reading. When possible, end your sentences with a noun or verb. It gives your language more force." If you require him to create a Bugzilla account to give first-hand feedback, just let me know.