Bug 387173 - Invalid Error Message While Creating A New Class
Summary: Invalid Error Message While Creating A New Class
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IDE4EDU (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 04:03 EDT by Rafi Kamal CLA
Modified: 2014-01-09 15:39 EST (History)
1 user (show)

See Also:


Attachments
Screenshot of the problem (96.42 KB, image/jpeg)
2012-08-14 04:04 EDT, Rafi Kamal CLA
no flags Details
A similar problem, invalid warning in the create class window (37.73 KB, image/jpeg)
2012-08-16 08:10 EDT, Rafi Kamal CLA
no flags Details
Patch (1.29 KB, patch)
2012-08-16 11:18 EDT, Rafi Kamal CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafi Kamal CLA 2012-08-14 04:03:25 EDT
Screenshot attached
Comment 1 Rafi Kamal CLA 2012-08-14 04:04:44 EDT
Created attachment 219839 [details]
Screenshot of the problem
Comment 2 Rafi Kamal CLA 2012-08-14 05:00:48 EDT
The problem seems to be here:
IStatus org.eclipse.ide4edu.javalite.constructors.NewJavaClassConstructor.getStatus()
at Line 247:
status = JavaConventions.validateJavaTypeName(className, sourceLevel, complianceLevel);

status should be "ClassName is not a valid identifier" but it is returnning "A package name must not be empty"
Comment 3 Wayne Beaton CLA 2012-08-14 11:01:57 EDT
Rafi, are you interested/able to submit a patch?

I ask because this project exists for two reasons: (1) to provide an IDE that is crafted specifically for students, and (2) to provide a entry point for students/others to participate in the open source experience. Much of the current code base has been contributed by students.

I can assist. Or, if you just want the bug fixed, I can do that too.
Comment 4 Rafi Kamal CLA 2012-08-16 08:08:13 EDT
I tried out this project for open source experience, and I'm interested in submitting patch too, but unfortunately I'm not able to this yet :( This project seems to be a bit hard for me, specially for extensive use of org.eclipse libraries and SWT libraries, I'm not familiar with these. But still I'm trying to understand the main workflow. I'll be grateful if you provide some guidance what things I need to learn to contribute in this project, and what do you need most i.e. documentation, bug-fix or code. It may take months for me to actively join, but I'll be happy to help at any way :)
And for this particular bug, I think the problem lies with this method JavaConventions.validateJavaTypeName(className, sourceLevel, complianceLevel); I found it is a method of org.eclipse.jdt.core package, not directly associated with ide4edu. May be we are using an old version... ?
Comment 5 Rafi Kamal CLA 2012-08-16 08:10:01 EDT
Created attachment 219956 [details]
A similar problem, invalid warning in the create class window
Comment 6 Rafi Kamal CLA 2012-08-16 08:22:35 EDT
I read the documentation of org.eclipse.jdt.core.JavaConventions and I think I've found the problem. JavaConventions.validateJavaTypeName(className, sourceLevel, complianceLevel) method is used here, but I think it should be JavaConventions.validateClassFileName(String id, String sourceLevel, String complianceLevel). But just changing the method name is creating some other problems. But I hope I can solve it and submit a patch :)
Comment 7 Rafi Kamal CLA 2012-08-16 11:18:45 EDT
Created attachment 219965 [details]
Patch

This patch should work. I didn't take part in any open source project before, so please let me know if I did something wrong.. I've found a similar minor bug, I hope I can fix that too.