j2s-development] Re: Many bugs solved, please check them out!
Brought to you by:
zhourenjian
From: Josson S. <jo...@sj...> - 2006-05-27 15:18:17
|
Hi Soheil, I reviewed those codes you modified and those built *.z.js. And I knew the problem you met. You may first check out the project net.sf.j2s.core and then if there are any updates, you should export the plugin net.sf.j2s.core to your Eclipse environment, and then restart Eclipse and rebuild the project net.sf.j2s.java.core and net.sf.j2s.java.org.eclipse.swt and re-pack those *.z.js. If you have other related test projects, clear and rebuild those projects. So, I found some of the modifications should be reverted. For example: Display.java: int [] indexTable = new int[0]; Control [] controlTable = new Control[0]; should stay to int [] indexTable; Control [] controlTable; as there are /* Initialize the Widget Table */ indexTable = new int [GROW_SIZE]; controlTable = new Control [GROW_SIZE]; in Display#init() In Java, Display#init() will called first (by super constructor's abstract Device#init) and then indexTable = new int[0]; controlTable = new Control[0]; will be called later unexpectly after the super constructor(Device) is called. So it would be incorrect for your modification. Someone says this is the most unknown mistake of Java programming. And Java2Script core still has its problem on such thing, I will fix as possible found. If you find some other unexpected (different from Java) JavaScript result from the converted *.js, try to describe it and report it to me. And second, I am wondering why you want to rename Color background = null; Color foreground = null; to Color backgroundColor = null; Color foregroundColor = null; Is it some bugs when running some certain snippets? If so, please check in those snippets codes (May be in the tests/net.sf.j2s.test.swt) Duplicate fields are supported in Java2Script, so it should not be renamed in Java sources. If things go wrong, it's considered as a bug of net.sf.j2s.core not a bug of net.sf.j2s.java.org.eclipse.swt. So revert the codes. Or modify the Control.java instead of modify SashForm.java, and Control belongs to package org.eclipse.swt.widget, which always has the platform-specific(Now browser-platform) codes, and SashForm belongs to package org.eclipse.swt.custom, in which I would to reuse as most as possible of the sources from the original org.eclipse.swt.custrom. That's to say, try to keep the original sources from org.eclipse.swt.*. I think it will benefit us from support the coming SWT 3.2. And about the Snippet4 and others snippets, it seems that I break some codes about auto layout. I will fix it in the coming days. You can follow the examples of those Test*.java in the new created test project tests/net.sf.j2s.test.swt for your debuggings. In all, you should do: 1. re-export the updated project net.sf.j2s.core 2. re-build *.java.core and *.java.org.eclipse.swt 3. re-check the necessary of your modifications, if no bugs after step 1. and 2. try to revert the codes into last status and commit. 4. work on other widgets as the examples of test/net.sf.j2s.test.swt (I will work on Shell and layout problem in these days) Josson Smith Soheil Hassas Yeganeh wrote: > > > |