Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314740 - Malformed error messages returned from org.eclipse.jdt.core.JavaConventions APIs.
Summary: Malformed error messages returned from org.eclipse.jdt.core.JavaConventions A...
Status: CLOSED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-05-27 13:55 EDT by Paul Slauenwhite CLA
Modified: 2010-06-23 12:56 EDT (History)
1 user (show)

See Also:


Attachments
Regression tests (2.81 KB, patch)
2010-05-28 15:11 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2010-05-27 13:55:18 EDT
Malformed error messages returned from org.eclipse.jdt.core.JavaConventions APIs.

For example:

1) org.eclipse.jdt.core.JavaConventions.validatePackageName("&", "1.5", "1.5"): ". is not a valid Java identifier.

2) org.eclipse.jdt.core.JavaConventions.validateJavaTypeName("&", "1.5", "1.5"): The type name ". is not a valid identifier.
Comment 1 Paul Slauenwhite CLA 2010-05-27 22:14:35 EDT
Olivier, will this defect be deferred to Eclipse 3.6.1/2?
Comment 2 Olivier Thomann CLA 2010-05-28 08:32:26 EDT
Probably.
Comment 3 Olivier Thomann CLA 2010-05-28 15:08:52 EDT
(In reply to comment #0)
> 1) org.eclipse.jdt.core.JavaConventions.validatePackageName("&", "1.5", "1.5"):
> ". is not a valid Java identifier.
I tried this and I got:
'&' is not a valid Java identifier as the status message.


> 2) org.eclipse.jdt.core.JavaConventions.validateJavaTypeName("&", "1.5",
> "1.5"): The type name ". is not a valid identifier.
I get: The type name '&' is not a valid identifier

Not sure what you did to get your error messages.
Comment 4 Olivier Thomann CLA 2010-05-28 15:09:08 EDT
What build are you using ?
Comment 5 Olivier Thomann CLA 2010-05-28 15:11:51 EDT
Created attachment 170417 [details]
Regression tests

This adds two regression tests and shows that the "right" messages are returned.
Comment 6 Paul Slauenwhite CLA 2010-05-28 15:12:45 EDT
(In reply to comment #4)
> What build are you using ?

We are using Eclipse 3.6 RC2 (Windows XP).
Comment 7 Olivier Thomann CLA 2010-05-31 11:36:40 EDT
Could you please provide a setup so that I can reproduce it the way you get it?
I don't understand why your error messages would be different.
Comment 8 Olivier Thomann CLA 2010-05-31 11:37:24 EDT
Are you displaying the message in HTML or using a specific encoding ?
Comment 9 Olivier Thomann CLA 2010-06-03 13:22:37 EDT
Hi,

I would need more info on how you get these wrong messages. Right now simply calling the API returns expected error messages.
Comment 10 Olivier Thomann CLA 2010-06-09 12:02:54 EDT
Removing target as I still didn't get any steps to reproduce.
Comment 11 Olivier Thomann CLA 2010-06-17 12:23:54 EDT
Any update on how to reproduce these errors ?
No answer means I'll close as WORKSFORME.
Comment 12 Paul Slauenwhite CLA 2010-06-21 11:12:21 EDT
Apologies for the late reply (vacation).  

After a closer inspection of the code, the error messages returned from these APIs are in fact correct.  The original symptom is caused by the org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation not displaying the error message correctly in the wizard.
Comment 13 Paul Slauenwhite CLA 2010-06-23 12:56:48 EDT
Closing.