[gwt-contrib] Re: weak listener in GWT?

2009-03-26 Thread John Tamplin
On Thu, Mar 26, 2009 at 6:28 AM, Ed post2edb...@hotmail.com wrote:


 I am struggeling a bit with the issue I posted here:

 http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/0c7013c88ff9f20b

 I would like to know if it would be possible to solve this with GWT
 before posting a RFC in the issue tracker.

 Would it even be possible to support the JRE WeakReference object? or
 in someway the weak listener support like done in Swing?


Javascript has no concept of a weak reference, so we can't implement it in
GWT.


 I think this is getting a bigger issue now that GWT is getting more
 used to make more advanced enterprise-like applications.

 My experience: In simple applications it's no problem to clean up your
 own objects and listeners, but in more advanced applciations that I am
 building nowadays with GWT, I noticed that this is a serious drawback
 and it's very easy to great memory leaks.


You just have to design your app from the beginning such that you don't leak
references.  For example, the way native objects in the browser are
implemented, you wind up with a reference cycle (the listener holds a
reference to an element and the element holds a reference to its listener,
and since the native objects are typically reference counted and not visible
to the JS GC the cycles can't be collected), and the way we avoid leaks is
to be diligent about when such cycles are created/destroyed (in this case
attached to the DOM vs detached).  If you are building your own listener
structures, you need to have similar diligence.

This is a general JS problem and GWT can't perform miracles -- well not that
miracle anyway :).

-- 
John A. Tamplin
Software Engineer (GWT), Google

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5086 - Checkstyle cleanup.

2009-03-26 Thread codesite-noreply

Author: j...@google.com
Date: Thu Mar 26 06:25:13 2009
New Revision: 5086

Modified:
 
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JdtCompilationUnit.java
 
changes/jat/ihm/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java

Log:
Checkstyle cleanup.


Modified:  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JdtCompilationUnit.java
==
---  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JdtCompilationUnit.java   
 
(original)
+++  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JdtCompilationUnit.java   
 
Thu Mar 26 06:25:13 2009
@@ -17,7 +17,6 @@

  import com.google.gwt.dev.jdt.TypeRefVisitor;
  import com.google.gwt.dev.util.Name;
-import com.google.gwt.dev.util.Name.BinaryName;
  import com.google.gwt.dev.util.Name.InternalName;

  import org.eclipse.jdt.core.compiler.CategorizedProblem;

Modified:  
changes/jat/ihm/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java
==
---  
changes/jat/ihm/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java  
 
(original)
+++  
changes/jat/ihm/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java  
 
Thu Mar 26 06:25:13 2009
@@ -268,7 +268,6 @@
  }
  return packageName + . + className;
}
-

private String generateRuntimeSelection(TreeLogger logger,
GeneratorContext context, JClassType targetClass,

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: weak listener in GWT?

2009-03-26 Thread Ed

He John,

Thanks for your answer.
Not very unexpected, but I was hoping I missed something.

This means that I have to do some more work when removing objects.

My situation:
I have pages  that make up a wizard-like application (part of the
application).
The pages contain form field where the user fills in his name, social
nr, etc..
When he goes back in the wizard tree and changes his birthday for
example: other form fields on other pages are removed. However, they
have a bunch of listeners subscribed to a global data model.
Because of all the nested objects, it's easy to forget unregistering a
listener.

Basically what I do now (and have to do more): before making a form
field variable NULL, call the formField.remove() method, that he
forwards to his nested objects, and so on
A bit cumbersome, but I don't see no other way, do you ??

-- Ed

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5087 - Disable ImageResourceTest

2009-03-26 Thread codesite-noreply

Author: b...@google.com
Date: Thu Mar 26 07:44:46 2009
New Revision: 5087

Modified:
trunk/user/test/com/google/gwt/resources/ResourcesSuite.java

Log:
Disable ImageResourceTest

Patch by: bobv
Review by: rjrjr (TBR)


Modified: trunk/user/test/com/google/gwt/resources/ResourcesSuite.java
==
--- trunk/user/test/com/google/gwt/resources/ResourcesSuite.java
(original)
+++ trunk/user/test/com/google/gwt/resources/ResourcesSuite.javaThu Mar 
26  
07:44:46 2009
@@ -37,7 +37,8 @@
  suite.addTestSuite(CssReorderTest.class);
  suite.addTestSuite(CssRtlTest.class);
  suite.addTestSuite(CssNodeClonerTest.class);
-suite.addTestSuite(ImageResourceTest.class);
+// TODO(bobv) Re-enable after fixing this case in non-inlining mode
+// suite.addTestSuite(ImageResourceTest.class);
  suite.addTestSuite(NestedBundleTest.class);
  suite.addTestSuite(TextResourceTest.class);


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] JavaScriptException with 1.6.2

2009-03-26 Thread nicolas de loof
Hi
I just tried the new gwt 1.6 RC and get this stacktrace :

[FATAL] Uncaught JavaScript exception [*
com.google.gwt.core.client.JavaScriptException*: (TypeError): 'nodeType' a
la valeur Null ou n'est pas un objet.

[FATAL]  number: -2146823281

[FATAL]  description: 'nodeType' a la valeur Null ou n'est pas un objet.

[FATAL] at com.google.gwt.dom.client.Node$.is(*Native Method*)

[FATAL] at com.google.gwt.dom.client.Element$.is(*Element.java:48*)

[FATAL] at com.google.gwt.user.client.ui.PopupPanel.eventTargetsPopup(*
PopupPanel.java:932*)

[FATAL] at com.google.gwt.user.client.ui.PopupPanel.previewNativeEvent(*
PopupPanel.java:1104*)

[FATAL] at com.google.gwt.user.client.ui.PopupPanel.access$6(*
PopupPanel.java:1085*)

[FATAL] at
com.google.gwt.user.client.ui.PopupPanel$2.onPreviewNativeEvent(*
PopupPanel.java:1199*)

[FATAL] at com.google.gwt.user.client.Event$NativePreviewEvent.dispatch(
*Event.java:181*)

[FATAL] at com.google.gwt.user.client.Event$NativePreviewEvent.dispatch(
*Event.java:1*)

[FATAL] at
com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(*
HandlerManager.java:60*)

[FATAL] at
com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(*
HandlerManager.java:53*)

[FATAL] at com.google.gwt.event.shared.HandlerManager.fireEvent(*
HandlerManager.java:178*)

[FATAL] at com.google.gwt.user.client.Event$NativePreviewEvent.fire(*
Event.java:80*)

[FATAL] at com.google.gwt.user.client.Event$NativePreviewEvent.access$4(
*Event.java:73*)

[FATAL] at com.google.gwt.user.client.Event$.fireNativePreviewEvent(*
Event.java:412*)

[FATAL] at com.google.gwt.user.client.DOM.previewEvent(*DOM.java:1284*)]
in
http://localhost:8080/bios-rc/com.sfr.bios.rc.CONX/hosted.html?com_sfr_bios_rc_CONX,
line 7


Is there any usefull information I could send you to help getting it fixed ?

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: JavaScriptException with 1.6.2

2009-03-26 Thread Scott Blum
That's not good  it looks like Nicolas found an object for which trying
to evaluate (!!o.nodeType) throws an exception.
@Nicolas:

- What browser is this?

- What are you actually doing to trigger the exception?

- Can you repro it on any popup panel, or is it specific to your app?

On Thu, Mar 26, 2009 at 12:14 PM, nicolas de loof
nicolas.del...@gmail.comwrote:

 Hi
 I just tried the new gwt 1.6 RC and get this stacktrace :

 [FATAL] Uncaught JavaScript exception [*
 com.google.gwt.core.client.JavaScriptException*: (TypeError): 'nodeType' a
 la valeur Null ou n'est pas un objet.

 [FATAL]  number: -2146823281

 [FATAL]  description: 'nodeType' a la valeur Null ou n'est pas un objet.

 [FATAL] at com.google.gwt.dom.client.Node$.is(*Native Method*)

 [FATAL] at com.google.gwt.dom.client.Element$.is(*Element.java:48*)

 [FATAL] at com.google.gwt.user.client.ui.PopupPanel.eventTargetsPopup(
 *PopupPanel.java:932*)

 [FATAL] at com.google.gwt.user.client.ui.PopupPanel.previewNativeEvent(
 *PopupPanel.java:1104*)

 [FATAL] at com.google.gwt.user.client.ui.PopupPanel.access$6(*
 PopupPanel.java:1085*)

 [FATAL] at
 com.google.gwt.user.client.ui.PopupPanel$2.onPreviewNativeEvent(*
 PopupPanel.java:1199*)

 [FATAL] at
 com.google.gwt.user.client.Event$NativePreviewEvent.dispatch(*
 Event.java:181*)

 [FATAL] at
 com.google.gwt.user.client.Event$NativePreviewEvent.dispatch(*Event.java:1
 *)

 [FATAL] at
 com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(*
 HandlerManager.java:60*)

 [FATAL] at
 com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(*
 HandlerManager.java:53*)

 [FATAL] at com.google.gwt.event.shared.HandlerManager.fireEvent(*
 HandlerManager.java:178*)

 [FATAL] at com.google.gwt.user.client.Event$NativePreviewEvent.fire(*
 Event.java:80*)

 [FATAL] at
 com.google.gwt.user.client.Event$NativePreviewEvent.access$4(*
 Event.java:73*)

 [FATAL] at com.google.gwt.user.client.Event$.fireNativePreviewEvent(*
 Event.java:412*)

 [FATAL] at com.google.gwt.user.client.DOM.previewEvent(*DOM.java:1284*)]
 in
 http://localhost:8080/bios-rc/com.sfr.bios.rc.CONX/hosted.html?com_sfr_bios_rc_CONX,
 line 7


 Is there any usefull information I could send you to help getting it fixed
 ?

 


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: [google-web-toolkit commit] r5087 - Disable ImageResourceTest

2009-03-26 Thread Ray Ryan
LGTM

2009/3/26 codesite-nore...@google.com


 Author: b...@google.com
 Date: Thu Mar 26 07:44:46 2009
 New Revision: 5087

 Modified:
trunk/user/test/com/google/gwt/resources/ResourcesSuite.java

 Log:
 Disable ImageResourceTest

 Patch by: bobv
 Review by: rjrjr (TBR)


 Modified: trunk/user/test/com/google/gwt/resources/ResourcesSuite.java

 ==
 --- trunk/user/test/com/google/gwt/resources/ResourcesSuite.java
  (original)
 +++ trunk/user/test/com/google/gwt/resources/ResourcesSuite.javaThu
 Mar 26
 07:44:46 2009
 @@ -37,7 +37,8 @@
  suite.addTestSuite(CssReorderTest.class);
  suite.addTestSuite(CssRtlTest.class);
  suite.addTestSuite(CssNodeClonerTest.class);
 -suite.addTestSuite(ImageResourceTest.class);
 +// TODO(bobv) Re-enable after fixing this case in non-inlining mode
 +// suite.addTestSuite(ImageResourceTest.class);
  suite.addTestSuite(NestedBundleTest.class);
  suite.addTestSuite(TextResourceTest.class);


 


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5089 - Edited wiki page through web user interface.

2009-03-26 Thread codesite-noreply

Author: amitman...@google.com
Date: Thu Mar 26 10:32:17 2009
New Revision: 5089

Modified:
wiki/GwtJavaApiCompatibilityChecker.wiki

Log:
Edited wiki page through web user interface.

Modified: wiki/GwtJavaApiCompatibilityChecker.wiki
==
--- wiki/GwtJavaApiCompatibilityChecker.wiki(original)
+++ wiki/GwtJavaApiCompatibilityChecker.wikiThu Mar 26 10:32:17 2009
@@ -107,9 +107,7 @@
  = Discussion =

  The !ApiCompatibilityChecker tool uses !TypeOracle to compute the API  
differences. !TypeOracle in turn requires access to the java source code.  
Thus the tool can only work when Java source is available. An alternative  
to !TypeOracle would be to use Java reflection which works on class files,  
and would not have required access to the source files. However, because of  
three disadvantages, we chose !TypeOracle over Java relfection:
-
 # One use case for the tool was to make the JRE library support that  
GWT offers  be compatible to a real JRE implementation. However, the JRE  
libraries that GWT currently offers are not complete, and are currently not  
offered as class files. The use of Java reflection would have prevented us  
from running the tool to compare GWT's current support of JRE with a real  
JRE.
-   # Annotations that have a retention policy of  SOURCE are only present  
in source files -- they are discarded by the compiler during the generation  
of class files. For example, the @deprecated annotation falls in this  
category. This annotation is particularly useful for the API Compatibility  
Checker tool, since the tool can ignore API changes in members, classes, or  
packages that are deprecated. The tool currently does not support  
annotations, but with little effort, it can be supported in the next  
version.
 # With !TypeOracle, we could tap into the already existing GWT compiler  
infrastructure. We could not find an analogous tool (with compatible  
licenses) in case of Java Reflection. (Japize, a tool which uses Java  
reflection to check for binary compatibility, could have  been suitable,  
but the tool was under a GPL license.)  With Reflection, everything would  
have to be developed from scratch.

  = References =

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5090 - Edited wiki page through web user interface.

2009-03-26 Thread codesite-noreply

Author: amitman...@google.com
Date: Thu Mar 26 10:52:25 2009
New Revision: 5090

Modified:
wiki/GwtJavaApiCompatibilityChecker.wiki

Log:
Edited wiki page through web user interface.

Modified: wiki/GwtJavaApiCompatibilityChecker.wiki
==
--- wiki/GwtJavaApiCompatibilityChecker.wiki(original)
+++ wiki/GwtJavaApiCompatibilityChecker.wikiThu Mar 26 10:52:25 2009
@@ -106,9 +106,7 @@

  = Discussion =

-The !ApiCompatibilityChecker tool uses !TypeOracle to compute the API  
differences. !TypeOracle in turn requires access to the java source code.  
Thus the tool can only work when Java source is available. An alternative  
to !TypeOracle would be to use Java reflection which works on class files,  
and would not have required access to the source files. However, because of  
three disadvantages, we chose !TypeOracle over Java relfection:
-   # One use case for the tool was to make the JRE library support that  
GWT offers  be compatible to a real JRE implementation. However, the JRE  
libraries that GWT currently offers are not complete, and are currently not  
offered as class files. The use of Java reflection would have prevented us  
from running the tool to compare GWT's current support of JRE with a real  
JRE.
-   # With !TypeOracle, we could tap into the already existing GWT compiler  
infrastructure. We could not find an analogous tool (with compatible  
licenses) in case of Java Reflection. (Japize, a tool which uses Java  
reflection to check for binary compatibility, could have  been suitable,  
but the tool was under a GPL license.)  With Reflection, everything would  
have to be developed from scratch.
+The !ApiCompatibilityChecker tool uses !TypeOracle to compute the API  
differences. !TypeOracle in turn requires access to the java source code.  
Thus the tool can only work when Java source is available. An alternative  
to !TypeOracle would be to use Java reflection which works on class files,  
and would not have required access to the source files. However, we  
chose !TypeOracle over Java relfection because with !TypeOracle, we could  
tap into the already existing GWT compiler infrastructure. We could not  
find an analogous tool (with compatible licenses) in case of Java  
Reflection. (Japize, a tool which uses Java reflection to check for binary  
compatibility, could have  been suitable, but the tool was under a GPL  
license.)  With Reflection, everything would have to be developed from  
scratch.

  = References =
 # http://wiki.eclipse.org/index.php/Evolving_Java-based_APIs

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Comment on GwtJavaApiCompatibilityChecker in google-web-toolkit

2009-03-26 Thread codesite-noreply

Comment by sco...@google.com:

Hey, what if we used ASM to process the class files? :D


For more information:
http://code.google.com/p/google-web-toolkit/wiki/GwtJavaApiCompatibilityChecker

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: JavaScriptException with 1.6.2

2009-03-26 Thread John Tamplin
On Thu, Mar 26, 2009 at 1:40 PM, Scott Blum sco...@google.com wrote:

 That's not good  it looks like Nicolas found an object for which trying
 to evaluate (!!o.nodeType) throws an exception.


If my atrophied high-school French is correct, I believe the error is that o
is null at that point.

-- 
John A. Tamplin
Software Engineer (GWT), Google

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: JavaScriptException with 1.6.2

2009-03-26 Thread nicolas de loof
Nice translation ;)
The dev team repported me this error but I'm not working on the module
myself.

I'll try to get more info on how the PopupPanel is used. I think it is part
of the DatePicker but have to confirm.
Must also ask which browser is used in this test.


On Thu, Mar 26, 2009 at 7:18 PM, John Tamplin j...@google.com wrote:

 On Thu, Mar 26, 2009 at 1:40 PM, Scott Blum sco...@google.com wrote:

 That's not good  it looks like Nicolas found an object for which
 trying to evaluate (!!o.nodeType) throws an exception.


 If my atrophied high-school French is correct, I believe the error is that
 o is null at that point.

 --
 John A. Tamplin
 Software Engineer (GWT), Google


 


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Comment on GwtJavaApiCompatibilityChecker in google-web-toolkit

2009-03-26 Thread codesite-noreply

Comment by to...@google.com:

That's an excellent idea. I wish someone had thought of it earlier. ;)

In case it's not obvious, the biggest benefit of this is that we could  
compatibility check code that does not build, or is difficult to build,  
with TypeOracle.



For more information:
http://code.google.com/p/google-web-toolkit/wiki/GwtJavaApiCompatibilityChecker

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: code review requested - add skeleton of runtime locales test

2009-03-26 Thread Scott Blum
LG as a pattern.. I have no idea what the test does. :)
Nitpick: comment on the line you modified in your version of junit.html?

On Tue, Mar 24, 2009 at 8:47 PM, John Tamplin j...@google.com wrote:

 This just does a couple of tests that need to be fleshed out, but basically
 just proves that your suggestion of putting a hacked junit.html into a
 public path of a particular test module works for setting the runtime
 locale.

 --
 John A. Tamplin
 Software Engineer (GWT), Google


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: code review requested - add skeleton of runtime locales test

2009-03-26 Thread John Tamplin
On Thu, Mar 26, 2009 at 3:46 PM, Scott Blum sco...@google.com wrote:

 LG as a pattern.. I have no idea what the test does. :)


It just verifies that certain things still work if the runtime locale is
specified even though the compile-time locale doesn't include them.


 Nitpick: comment on the line you modified in your version of junit.html?


Ok.

Is there any way we could avoid duplicating junit.html?  If we have a number
of runtime locale tests, there are going to be lots of copies of this that
we have to remember to update whenever junit.html is updated.

-- 
John A. Tamplin
Software Engineer (GWT), Google

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: RR: testing -noserver hosted mode

2009-03-26 Thread John Tamplin
On Tue, Feb 17, 2009 at 2:27 AM, Lex Spoon sp...@google.com wrote:

 Revision 3901 broke -noserver hosted mode, but it took weeks before
 anyone even noticed.  I've been trying to figure out how to write a
 regression test to prevent that sort of thing from happening.

 Attached is a patch that I believe does the trick.  Hosted mode gurus,
 as well as people who know the GWTTestCase infrastructure, would be
 very welcome to chime in on the right way to do this!

 I figure that a -noserver hosted mode test is actually pretty close to
 the existing hosted mode tests.  There are just two differences I see.
  First, a compile needs to actually run.  Second, all auto-generation
 of resources should be disabled in the GWTShellServlet.  By turning
 off all auto-generation, the servlet can pretend to be a dumb web
 server that knows nothing about GWT.

 What the patch does is add a new run style called -noserver.  This is
 a subclass of the regular hosted mode run style that includes the
 above two changes.  The trickiest part is that RunStyle now has a
 parameter on whether auto-generation should happen with the embedded
 server.  This parameter had to be passed all the way from RunStyle to
 JUnitShell to GWTShell to EmbeddedTomcatServer to GWTShellServlet.
 Any simpler idea would be welcome.

 Because it's easy, the patch also turns off resource generation for
 web mode tests.  The reasoning is that it's a slightly better test of
 web mode to prefer the files that actually resulted from compilation.

 To get the test hooked into the build scripts, I added ant
 test.noserver in the user directory, and had this called when ant
 test is called.  There is only one test that this runs: the
 IFrameLinkerTest.  The other linkers don't work in noserver mode.
 Also, no other tests are run in noserver mode; I don't see a
 significant benefit to running the other ones this way, because once
 an app is booted up everything will be identical to regular hosted
 mode.

 John, if the general strategy looks good to everyone, could you review
 the implementation?


Passing the parameter all the way down this way is ugly, but I don't know of
any better ways to do it.

I would prefer the new ArgHandler to be a top-level class, but I see the
others are inlined as well so I am ok with keeping it.

I don't see the build.xml changes for test.noserver.

Otherwise, LGTM.

Sorry this took so long.

-- 
John A. Tamplin
Software Engineer (GWT), Google

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: code review requested - add skeleton of runtime locales test

2009-03-26 Thread Scott Blum
We could add a feature to JUnit, of course.  Or maybe we could do something
to the default junit.html that allows a way to wedge in different deferred
binding props?
On Thu, Mar 26, 2009 at 3:49 PM, John Tamplin j...@google.com wrote:

 On Thu, Mar 26, 2009 at 3:46 PM, Scott Blum sco...@google.com wrote:

 LG as a pattern.. I have no idea what the test does. :)


 It just verifies that certain things still work if the runtime locale is
 specified even though the compile-time locale doesn't include them.


 Nitpick: comment on the line you modified in your version of junit.html?


 Ok.

 Is there any way we could avoid duplicating junit.html?  If we have a
 number of runtime locale tests, there are going to be lots of copies of this
 that we have to remember to update whenever junit.html is updated.

 --
 John A. Tamplin
 Software Engineer (GWT), Google

 


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5092 - Separate data that is constant across all locales in a build into a

2009-03-26 Thread codesite-noreply

Author: j...@google.com
Date: Thu Mar 26 15:02:57 2009
New Revision: 5092

Modified:
trunk/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java

Log:
Separate data that is constant across all locales in a build into a
LocaleInfoImpl_shared (which contains the native display names and
available locales) and the remainder in a per-locale source file.

Patch by: jat
Review by: scottb


Modified: trunk/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java
==
--- trunk/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java   
(original)
+++ trunk/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java  Thu  
Mar 26 15:02:57 2009
@@ -93,37 +93,24 @@
  assert  
(LocaleInfoImpl.class.getName().equals(targetClass.getQualifiedSourceName()));

  String packageName = targetClass.getPackage().getName();
-GwtLocale locale = LocaleUtils.getCompileLocale();
-String className = targetClass.getName().replace('.', '_') + _
-+ locale.getAsString();
-SetGwtLocale runtimeLocales = LocaleUtils.getRuntimeLocales();
-if (!runtimeLocales.isEmpty()) {
-  className += _runtimeSelection;
-}
-String qualName = packageName + . + className;
-
-PrintWriter pw = context.tryCreate(logger, packageName, className);
+String superClassName = targetClass.getName().replace('.', '_')  
+ _shared;
+SetGwtLocale localeSet = LocaleUtils.getAllLocales();
+GwtLocaleImpl[] allLocales = localeSet.toArray(new  
GwtLocaleImpl[localeSet.size()]);
+// sort for deterministic output
+Arrays.sort(allLocales);
+PrintWriter pw = context.tryCreate(logger, packageName,  
superClassName);
  if (pw != null) {
+  String qualName = packageName + . + superClassName;
ClassSourceFileComposerFactory factory = new  
ClassSourceFileComposerFactory(
-  packageName, className);
+  packageName, superClassName);
factory.setSuperclass(targetClass.getQualifiedSourceName());
-  factory.addImport(com.google.gwt.core.client.GWT);
factory.addImport(com.google.gwt.core.client.JavaScriptObject);
-  factory.addImport(com.google.gwt.i18n.client.LocaleInfo);
-   
factory.addImport(com.google.gwt.i18n.client.constants.NumberConstants);
-   
factory.addImport(com.google.gwt.i18n.client.constants.NumberConstantsImpl);
-   
factory.addImport(com.google.gwt.i18n.client.constants.DateTimeConstants);
-   
factory.addImport(com.google.gwt.i18n.client.constants.DateTimeConstantsImpl);
SourceWriter writer = factory.createSourceWriter(context, pw);
writer.println(private JavaScriptObject nativeDisplayNames;);
writer.println();
writer.println(@Override);
writer.println(public String[] getAvailableLocaleNames() {);
writer.println(  return new String[] {);
-  // sort for deterministic output
-  SetGwtLocale localeSet = LocaleUtils.getAllLocales();
-  GwtLocaleImpl[] allLocales = localeSet.toArray(new  
GwtLocaleImpl[localeSet.size()]);
-  Arrays.sort(allLocales);
for (GwtLocaleImpl possibleLocale : allLocales) {
  writer.println(\
  + possibleLocale.toString().replaceAll(\, \\\) + \,);
@@ -132,41 +119,12 @@
writer.println(});
writer.println();
writer.println(@Override);
-  writer.println(public String getLocaleName() {);
-  if (runtimeLocales.isEmpty()) {
-writer.println(  return \ + locale + \;);
-  } else {
-writer.println(  String rtLocale = getRuntimeLocale(););
-writer.println(  return rtLocale != null ? rtLocale : \ + locale
-+ \;);
-  }
-  writer.println(});
-  writer.println();
-  writer.println(@Override);
writer.println(public native String  
getLocaleNativeDisplayName(String localeName) /*-{);
writer.println(  this.@ + qualName  
+ ::ensureNativeDisplayNames()(););
writer.println(  return this.@ + qualName
+ ::nativeDisplayNames[localeName];);
writer.println(}-*/;);
writer.println();
-  writer.println(@Override);
-  writer.println(public DateTimeConstants getDateTimeConstants() {);
-  LocalizableGenerator localizableGenerator = new  
LocalizableGenerator();
-  // Avoid warnings for trying to create the same type multiple times
-  @SuppressWarnings(hiding)
-  GeneratorContext subContext = new CachedGeneratorContext(context);
-  generateConstantsLookup(logger, subContext, writer,  
localizableGenerator,
-  runtimeLocales, locale,
-  com.google.gwt.i18n.client.constants.DateTimeConstantsImpl);
-  writer.println(});
-  writer.println();
-  writer.println(@Override);
-  writer.println(public NumberConstants getNumberConstants() {);
-  generateConstantsLookup(logger, subContext, writer,  
localizableGenerator,
-  runtimeLocales, locale,
-  

[gwt-contrib] Re: [google-web-toolkit commit] r5078 - Amending r5077:

2009-03-26 Thread Vitali Lovich
On Thu, Mar 26, 2009 at 3:17 PM, Scott Blum sco...@google.com wrote:

 Vitali, are you positive all your stuff is in a legit state?  I ask because
 it looks like you're mixing trunk and 1.6 stuff together.


Can you clarify what you mean? How can I be mixing trunk  1.6 together?
I'm only using trunk.  At this point I don't event have the gwt-platform
directory in my project path - I just imported the GWT projects  made put
them on my classpath.

When I use a stock gwt-dev-windows.jar from 1...@r5090,

I'm using trunk (@ 5084 right now).  I haven't even tried stock because I'm
on linux 64-bit  I haven't bothered trying to get the 32-bit environment
set up for the old hosted mode (relying solely on OOPHM).



 I can boot your project just fine whether log4j-1.2.15.jar is in
 WEB-INF/lib or not.  (I can run it because I couldn't actually find a
 version of mosaic that you compile against cleanly, but the servlets all
 initialized just fine.)


Right - I forgot that the code I sent you at that point already had my
enhancements to mosaic (eventually a version of them should get into
truck).   In any case, you can just delete the code that throws up an error
(unless its the constructor).

My  code runs fine (including servlets)  the logging works.  It's just that
error
that gets printed to the console when the project launches, so it's not a
super-important issue.  Is it possible it's a Linux-only issue?



 Here's a dump of the exact dir structure that's working for me:

 .classpath

.project

gwt-windows-0.0.0
 gwt-windows-0.0.0/gwt-dev-windows.jar
 gwt-windows-0.0.0/gwt-ll.dll
 gwt-windows-0.0.0/gwt-user.jar
 gwt-windows-0.0.0/swt-win32-3235.dll
 lib
 lib/ftr-gwt-library-date-0.9.9.jar
 lib/ftr-gwt-library-date-emul-0.9.9.jar
 lib/gwt-beans-binding-0.2.3.jar
 lib/gwt-dnd-2.5.6.jar
 lib/gwt-incubator-trunk-r1543.jar
 lib/gwt-mosaic-0.2.0-rc1.jar
 lib/gwtx-1.5.2.jar
 lib/log4j-1.2.15.jar
  lib/org.cobogw.gwt-1.2.2.jar
 SacredHeart.launch
 src (omitted)
 war
 war/loading.gif
 war/SacredHeart.css
 war/SacredHeart.html
 war/WEB-INF
 war/WEB-INF/classes (omitted)
 war/WEB-INF/classes/ece456
 war/WEB-INF/classes/log4j.properties
 war/WEB-INF/lib
 war/WEB-INF/lib/gwt-servlet.jar
 war/WEB-INF/lib/log4j-1.2.15.jar
 war/WEB-INF/lib/mysql-connector-java-5.1.7-bin.jar
 war/WEB-INF/web.xml


 I attached the .project, .classpath, and launch config I'm using.  This
 configuration boots whether or not I have war/WEB-INF/lib/log4j-1.2.15.jar
 in there.

 On Wed, Mar 25, 2009 at 7:32 PM, Vitali Lovich vlov...@gmail.com wrote:


 On Wed, Mar 25, 2009 at 7:10 PM, Scott Blum sco...@google.com wrote:

 On Wed, Mar 25, 2009 at 6:22 PM, Vitali Lovich vlov...@gmail.comwrote:

 If I don't put the log4j file into my WEB-INF/lib directory, then it's
 fine.  If it is put there, then it gets the conflicting version (regardless
 of whether or not I launch HostedMode with log4j on the class path).  So am
 I doing it wrong?


 i'm confused... if you don't have log4j on the classpath, how can you be
 loading it via Launcher$AppClassLoader?  It must be hiding out in some other
 jar you have on the classpath?

 Sorry for the confusion.  Here's what I meant:
 If I add the log4j library in the WEB-INF/lib to the classpath of the
 runtime configuration, I get the problem above.
 If I move the log4j library out of the WEB-INF/lib directory to somewhere
 else like project/lib  add it to the classpath, then it works.


 Am I supposed to place it elsewhere  then copy it over to WEB-INF/lib
 when I'm packaging it up only?


 That's not the intent... can you send me a small sample that repros this?

 I don't have time right now.  If you want I can e-mail you my project
 privately.  It's a school project, so there's no confidentiality to it or
 anything.  I just don't want to spam the mailing list.

 Thanks


 Scott







 


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---