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

Bug 370694

Summary: Cannot generate html file for RUIHandler in VE or deployment
Product: z_Archived Reporter: Huang Ji Yong <hjiyong>
Component: EDTAssignee: Project Inbox <edt.ide.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: hjiyong, huozz, jeffdouglas, jspadea
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
part fix huozz: iplog+

Description Huang Ji Yong CLA 2012-02-06 04:58:43 EST
Steps to reproduce
1. Create a new Web 2.0 project
2. Create a new RUIHandler.
3. Open the RUIHandler in VE, an error occur. The error message is
document.write("Could not open /TestRUI/test.html"); 
4. Deploy the project, the RUIHandler html file is not generated.

This defect seems caused by a change maded to Generator.java which move the makeContext from generator constructor to initialize method.
Comment 1 Huo Zhen Zhong CLA 2012-02-06 05:54:59 EST
H
Comment 2 Huo Zhen Zhong CLA 2012-02-06 05:55:31 EST
Created attachment 210564 [details]
part fix
Comment 3 Huo Zhen Zhong CLA 2012-02-06 06:00:07 EST
Hi, Jeff
This is caused by the generator framework changes, I made a part fix, it can only solve some of the problem. but I met a problem, with the fix, it shows that the TemplateFactory can not find suitable template for generation, could you help to look at this problem, I think it is deep in the generator framework.


java.util.MissingResourceException: Can't find bundle for base name , locale en_US
	at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
	at java.util.ResourceBundle.getBundleImpl(Unknown Source)
	at java.util.ResourceBundle.getBundle(Unknown Source)
	at org.eclipse.edt.mof.codegen.api.TemplateFactory.load(TemplateFactory.java:68)
	at org.eclipse.edt.gen.Generator.initialize(Generator.java:53)
Comment 4 Jeff Douglas CLA 2012-02-06 15:04:08 EST
fixed. please resync on everything
Comment 5 Huo Zhen Zhong CLA 2012-02-08 03:34:50 EST
Hi Jeff
I use the latest code and still get problem when open VE, exceptions throws. Does your fix can solve the problem? Please help to look at it, thanks

java.lang.NullPointerException
	at org.eclipse.edt.gen.javascriptdev.ide.JavaScriptDevGenerator.generate(JavaScriptDevGenerator.java:39)
	at org.eclipse.edt.ide.rui.utils.WorkingCopyGenerationOperation.generateParts(WorkingCopyGenerationOperation.java:158)
	at org.eclipse.edt.ide.rui.utils.WorkingCopyGenerationOperation.generate(WorkingCopyGenerationOperation.java:131)
	at org.eclipse.edt.ide.rui.utils.JavaScriptPreviewGenerator.generateJavaScript(JavaScriptPreviewGenerator.java:121)
	at org.eclipse.edt.ide.rui.server.EvEditorProvider.generateJavaScript(EvEditorProvider.java:311)
Comment 6 Jeff Douglas CLA 2012-02-08 11:39:44 EST
fixed. resync on everything
Comment 7 Huo Zhen Zhong CLA 2012-02-09 03:09:09 EST
Hi, Jeff
I reopen it because I find a problem, in some place, xxx == Boolean.TRUE or xxx = Boolean.FALSE are used. for example, in line 58 of FieldTemplate.java, there is statement:
if (veEdit != null && veEdit == Boolean.TRUE && CommonUtilities.isRUIWidget(field.getType()))

it will not return true when event veEdit is true. That is because the "==" will compare the object id, not the object content, change it to veEdit.equals(Boolean.TRUE) will solve the problem. 

I did a search and found that there is a lot of xxx == Boolean.TRUE or xxx = Boolean.FALSE in the edt code. I think they need be corrected and tested. Thanks
Comment 8 Jeff Douglas CLA 2012-02-09 07:56:45 EST
I made those changes you mentioned below. Thank you.

Please resync on everything and try again. I have trouble getting this code to display anything, and I do not know where to look.

If you need other changes, let me know.
Comment 9 Justin Spadea CLA 2012-02-09 08:40:52 EST
Is there a reason that a Boolean value of true is not using Boolean.TRUE? The Boolean constructor should never be used, always use Boolean.valueOf() to prevent creating unnecessary objects. (Same can be said for many other core types like Integer, Long, etc)
Comment 10 Huang Ji Yong CLA 2012-02-20 00:10:33 EST
Verified in build  0.8.0.v201202190901-1Co-FjuJ6QMNRcrynsZh8h8C