[gwt-contrib] New GWT Form/Binding/Validation project: gwt-pectin

2009-08-13 Thread Andrew Pietsch

Hi all,

I've just uploaded a new prototype Form/Binding library based on
PresentationModel/ValueModel pattern.  It uses a builder style api
inspired by Guice.

It also support plugins for extending the functionality of the core
framework.  Currently there's a metadata plugin and a validation
plugin.

You can check it out and try the demo at: http://code.google.com/p/gwt-pectin/

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



[gwt-contrib] Re: New GWT Form/Binding/Validation project: gwt-pectin

2009-08-13 Thread Mathias Bogaert

One of the coolest things I've seen since UiBinder. Excellent work!

On Aug 13, 9:50 am, Andrew Pietsch  wrote:
> Hi all,
>
> I've just uploaded a new prototype Form/Binding library based on
> PresentationModel/ValueModel pattern.  It uses a builder style api
> inspired by Guice.
>
> It also support plugins for extending the functionality of the core
> framework.  Currently there's a metadata plugin and a validation
> plugin.
>
> You can check it out and try the demo at:http://code.google.com/p/gwt-pectin/
>
> Cheers
> Andrew
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] UiBinder and Model View Presenter

2009-08-13 Thread Andrés Testi

How the UiBinder fits in the MVP architecture proposed at the google I/
O talks? (http://code.google.com/intl/es-AR/events/io/sessions/
GoogleWebToolkitBestPractices.html)
Regards.

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



[gwt-contrib] Re: DTO compiler optimization

2009-08-13 Thread Nathan Wells

@Gary,

I've heard about the problems, but haven't experienced them myself. Is
there anything specific I should know about?

@Fred,

I've been experimenting with GWT.isClient() and GWT.isScript(), but to
no avail. Thus far I've only tried it in hosted mode with 1.7... is
there something I'm missing?

On Aug 12, 9:15 pm, Gary Miller  wrote:
> Nathan,
>
> I think we are getting to the point of violent agreement ;-)
> In my book there is no other way to build web application then GWT.
> GWT-RPC is incomplete or at least feels like it could be more
> powerful.
> And yes if the project called for it I would replace or enhance GWT-
> RPC.
> This doesn't remove the need for the GWT compiler.
>
> Have you read about or experienced the issues with GAE/J, GWT-RPC and
> JDO bindings?
>
> Regards
> Gary
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: New GWT Form/Binding/Validation project: gwt-pectin

2009-08-13 Thread Andrew Pietsch

Thanks (c:  It's still early days, but the approach seems to be
working quite well.  I'm hoping to get some more detailed
documentation up soonish.

Cheers

On Aug 13, 7:24 pm, Mathias Bogaert  wrote:
> One of the coolest things I've seen since UiBinder. Excellent work!
>
> On Aug 13, 9:50 am, Andrew Pietsch  wrote:
>
> > Hi all,
>
> > I've just uploaded a new prototype Form/Binding library based on
> > PresentationModel/ValueModel pattern.  It uses a builder style api
> > inspired by Guice.
>
> > It also support plugins for extending the functionality of the core
> > framework.  Currently there's a metadata plugin and a validation
> > plugin.
>
> > You can check it out and try the demo 
> > at:http://code.google.com/p/gwt-pectin/
>
> > Cheers
> > Andrew
>
>
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: DTO compiler optimization

2009-08-13 Thread John Tamplin
On Thu, Aug 13, 2009 at 7:46 AM, Nathan Wells  wrote:

> I've been experimenting with GWT.isClient() and GWT.isScript(), but to
> no avail. Thus far I've only tried it in hosted mode with 1.7... is
> there something I'm missing?
>

isClient/isScript isn't going to let you include non-translatable code in
the client sources or to directly remove fields (they could get removed by
virtue of no references remaining to them).

Using super-source allows you to write two different implementations for the
same class -- one used by the server, and one by the client.  Write your
server-side code in the same place, and put a super-source entry in your
module file pointing at a base directory for the translatable version -- see
the 
docfor
more info.

However, you have to be careful such that the server-side and client-side
implementations are compatible for serialization -- you may have to have a
custom serializer in order to make that work.

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

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



[gwt-contrib] Re: Extending ValueChangeEvent

2009-08-13 Thread jarrod

John,

The concern you raise is valid - how should one register sub-classes
for the right event, and should sub-class event handlers still be able
to handle super-class events?

I did run into this as well, and while I think it is a concern, I was
more immediately concerned with the issue at hand (extending
ValueChangeEvent).

In my application's case, my goal is essentially to have a
centralized, singleton instance of a HandlerManager so that events can
be distributed at a global level. I'd like to do this so that add-on
components can register and listen for events without needing to know
about the specific instances of other components that generate the
events (think plugins, and no Spring for dependency injection).

So far, the way I've handled this is to create a class called
Dispatcher that extends HandlerManager and implements EntryPoint.
Then, any class that wants to register as a global listener can just
use the global HandlerManager instance and the registration method
takes the event Type for which you are registering. Observe:


public class Dispatcher extends HandlerManager implements EntryPoint,
HasHandlers {

private static Dispatcher instance;

public static Dispatcher get() {
return Dispatcher.instance;
}

private Dispatcher() {
super(null);
}

@Override
public void onModuleLoad() {
Dispatcher.instance = this;

}

}


There are certainly some shortcomings with this method, so I would
welcome suggestions or improvements, but centralized event dispatching
is something I'd really like to see as a core function of GWT's event
handling system.


Thanks!




On Aug 10, 10:39 am, John Tamplin  wrote:
> On Mon, Aug 10, 2009 at 10:26 AM, John LaBanca  wrote:
> > I believe the problem is that if you extend ValueChangeEvent and
> > ValueChangeHandler, you can then call
> > Widget#addHandler(mySubValueChangeHandler, ValueChangeEvent.getType()),
> > creating a mismatch because you are associating a SubValueChangeHandler with
> > the ValueChangeEvent type.  While I don't think this will cause technically
> > any problems, it can lead to a little confusion because if you fire a
> > SubValueChangeEvent, your handler will not fire.
>
> > Still, I think we can just javadoc that and take off the final modifier.
>
> This could be useful in that you could register a change handler that takes
> a superclass event, and register it for some number of specific subclasses
> that you want to handle.
>
> Ideally, there would be a way to register a handler for all subclasses as
> well, ie:
>
>   addHandler(ValueChangeHandler handler, FooSuper.getType());
>
> and it would get triggered on FooSub1, FooSub2, etc as well.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: DTO compiler optimization

2009-08-13 Thread Nathan Wells
@John,
Thanks for the explanation. At this point, it seems like I might as well
write my DTOs and mappings.

@Google Devs
So, I kind of feel unsure about where we're at right now... are there
discussions happening? Has an executive decision been made? I'm don't want
to seem impatient (I know you guys have plenty to do)... but if a decision
has been made, I would like to know :)

As you can tell by Gary's comments, it seems like there is a movement to
simply replace GWT-RPC with an easier API anyway. I would rather Google take
the driving wheel, but if not, I think I would definitely get behind
anything that allows me to avoid the DTO ugliness I'm looking at now.

Nathan Wells


On Thu, Aug 13, 2009 at 7:16 AM, John Tamplin  wrote:

> On Thu, Aug 13, 2009 at 7:46 AM, Nathan Wells  wrote:
>
>> I've been experimenting with GWT.isClient() and GWT.isScript(), but to
>> no avail. Thus far I've only tried it in hosted mode with 1.7... is
>> there something I'm missing?
>>
>
> isClient/isScript isn't going to let you include non-translatable code in
> the client sources or to directly remove fields (they could get removed by
> virtue of no references remaining to them).
>
> Using super-source allows you to write two different implementations for
> the same class -- one used by the server, and one by the client.  Write your
> server-side code in the same place, and put a super-source entry in your
> module file pointing at a base directory for the translatable version -- see
> the 
> docfor
>  more info.
>
> However, you have to be careful such that the server-side and client-side
> implementations are compatible for serialization -- you may have to have a
> custom serializer in order to make that work.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>
> >
>

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



[gwt-contrib] Re: reenable SOYC dependencies files for non-split programs

2009-08-13 Thread kprobst

LGTM.

http://gwt-code-reviews.appspot.com/56815

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



[gwt-contrib] Re: UiBinder and Model View Presenter

2009-08-13 Thread Joel Webber
I don't want to speak for Ray here, since he gave the presentation, but my
view is that they're largely orthogonal. UiBinder makes it easier to create
views, but it has nothing in particular to say about how those views get
bound to data. Its main goal is to remove the pain of UI construction, and
to make it easier to mix widgets and HTML, hopefully leading to easier *and*
more efficient UIs.
>From what I can see, there are a lot of approaches being explored by
different teams for MVP, data binding, and other high-level architectures. I
hope they will all mesh nicely with UiBinder.

On Thu, Aug 13, 2009 at 5:27 AM, Andrés Testi wrote:

>
> How the UiBinder fits in the MVP architecture proposed at the google I/
> O talks? (http://code.google.com/intl/es-AR/events/io/sessions/
> GoogleWebToolkitBestPractices.html)
> Regards.
>
> - Andrés
> >
>

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



[gwt-contrib] [google-web-toolkit] r5957 committed - Allow LinkedHashMap to be serialized in the AppEngine environment,...

2009-08-13 Thread codesite-noreply

Revision: 5957
Author: r...@google.com
Date: Thu Aug 13 08:05:36 2009
Log: Allow LinkedHashMap to be serialized in the AppEngine environment,
where it is not possible to use reflection to query the accessOrder
field.

Review by: jlabanca


http://code.google.com/p/google-web-toolkit/source/detail?r=5957

Modified:
   
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
  /trunk/user/test/com/google/gwt/user/client/rpc/CollectionsTest.java

===
---  
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
Fri May 23 08:38:33 2008
+++  
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
Thu Aug 13 08:05:36 2009
@@ -34,6 +34,54 @@
  Map_CustomFieldSerializerBase.deserialize(streamReader, instance);
}

+  /**
+   * Infers the value of the private accessOrder field of instance by  
examining
+   * its behavior on a set of test inputs, without using reflection. Note  
that
+   * this implementation clones the instance, which could be slow.
+   *
+   * @param instance the instance to check
+   * @return the value of instance.accessOrder
+   */
+  @SuppressWarnings("unchecked") // raw LinkedHashMap
+  public static boolean getAccessOrderNoReflection(LinkedHashMap instance)  
{
+/*
+ * Clone the instance so our modifications won't affect the original.
+ * In particular, if the original overrides removeEldestEntry, adding
+ * elements to the map could cause existing elements to be removed.
+ */
+instance = (LinkedHashMap) instance.clone();
+instance.clear();
+
+/*
+ * We insert key1, then key2, after which we access key1. We then  
iterate
+ * over the key set and observe the order in which keys are returned.  
The
+ * iterator will return keys in the order of least recent insertion or
+ * access, depending on the value of the accessOrder field within the
+ * LinkedHashMap instance. If the iterator is ordered by least recent
+ * insertion (accessOrder = false), we will encounter key1 first since  
key2
+ * has been inserted more recently. If it is ordered by least recent  
access
+ * (accessOrder = true), we will encounter key2 first, since key1 has  
been
+ * accessed more recently.
+ */
+Object key1 = new Object();
+Object key2 = new Object();
+instance.put(key1, key1); // INSERT key1
+instance.put(key2, key2); // INSERT key2
+instance.get(key1);   // ACCESS key1
+boolean accessOrder = false;
+for (Object key : instance.keySet()) {
+  if (key == key1) {
+break;
+  }
+  if (key == key2) {
+accessOrder = true;
+break;
+  }
+}
+
+return accessOrder;
+  }
+
@SuppressWarnings("unchecked") // raw LinkedHashMap
public static LinkedHashMap instantiate(SerializationStreamReader  
streamReader)
throws SerializationException {
@@ -49,21 +97,23 @@
}

@SuppressWarnings("unchecked") // raw LinkedHashMap
-  private static boolean getAccessOrder(LinkedHashMap instance)
-  throws SerializationException {
+  private static boolean getAccessOrder(LinkedHashMap instance) {
  Field accessOrderField;
  try {
accessOrderField =  
LinkedHashMap.class.getDeclaredField("accessOrder");
accessOrderField.setAccessible(true);
return ((Boolean) accessOrderField.get(instance)).booleanValue();
  } catch (SecurityException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (NoSuchFieldException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (IllegalArgumentException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (IllegalAccessException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
-}
+  // fall through
+}
+
+// Use a (possibly slower) technique that does not require reflection.
+return getAccessOrderNoReflection(instance);
}
  }
===
---  
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java

Thu Aug 28 17:26:44 2008
+++  
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java

Thu Aug 13 08:05:36 2009
@@ -31,6 +31,12 @@
LinkedHashMap instance) throws SerializationException {
  Map_CustomFieldSerializerBase.deserialize(streamReader, instance);
}
+
+  @SuppressWarnings("unchecked") // raw LinkedHashMap
+  // 

[gwt-contrib] Re: UiBinder and Model View Presenter

2009-08-13 Thread Andrés Testi

Thanks a lot, Joel. It seems to be data binding resolution will be the
next big step in GWT.
Regards.

- Andrés

On 13 ago, 11:24, Joel Webber  wrote:
> I don't want to speak for Ray here, since he gave the presentation, but my
> view is that they're largely orthogonal. UiBinder makes it easier to create
> views, but it has nothing in particular to say about how those views get
> bound to data. Its main goal is to remove the pain of UI construction, and
> to make it easier to mix widgets and HTML, hopefully leading to easier *and*
> more efficient UIs.
> From what I can see, there are a lot of approaches being explored by
> different teams for MVP, data binding, and other high-level architectures. I
> hope they will all mesh nicely with UiBinder.
>
> On Thu, Aug 13, 2009 at 5:27 AM, Andrés Testi wrote:
>
>
>
> > How the UiBinder fits in the MVP architecture proposed at the google I/
> > O talks? (http://code.google.com/intl/es-AR/events/io/sessions/
> > GoogleWebToolkitBestPractices.html)
> > Regards.
>
> > - Andrés
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Rework emulated stack trace with conditional properties

2009-08-13 Thread bobv

Reviewers: bruce,

Message:
@Bruce, does the following work for you?

 
   
 
 
   
 
 
 {
   return location.search.indexOf('emulatedStack') != -1 ? 'true' :
'false';
 }
 


Description:
This changes how JS stack emulation is enabled to take advantage of
conditional deferred-binding properties.

Please review this at http://gwt-code-reviews.appspot.com/56816

Affected files:
   M user/src/com/google/gwt/core/CompilerParameters.gwt.xml
   M user/src/com/google/gwt/core/Core.gwt.xml
   M user/src/com/google/gwt/core/CoreWithUserAgent.gwt.xml
   M user/src/com/google/gwt/core/EmulateJsStack.gwt.xml
   M user/src/com/google/gwt/junit/JUnit.gwt.xml



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



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

2009-08-13 Thread codesite-noreply

Comment by nkreiff:

Compile-time cut and scaling to images is a very interesting and usefull  
tool.


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

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



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

2009-08-13 Thread codesite-noreply

Comment by nkreiff:

Crop and scale images in high resolution at compile time is a very useful  
feature. Thanks in advance.


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

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



[gwt-contrib] Re: Prettier GWT version names for upcoming 2.0 releases

2009-08-13 Thread Scott Blum
On Wed, Aug 12, 2009 at 6:39 PM, Bruce Johnson  wrote:

> Senator Blum,
>
> Do you mean "disturbing" as in
> 1) revolting,
> 2) distressing, or
> 3) disordering?
>

Distressing, I think.

-- Example #1 --

Please sort the following two lists chronlogically as quickly as you can:

List 1: "1.6.2", "1.6.5", "1.6.0", "1.6.1"

List 2: "2.0.0-rc2", "2.0.0-ms2", "2.0.0", "2.0.0-rc1"

-- Example #2 --

uberuser: There's a bug in GWT where tab panels explode on FF3.

gwtcoder: What version are you using?  I fixed that in 2.0.0.
 (+Status:Duplicate)

uberuser: I'm using 2.0.0 and it's still broken.

gwtcoder: Okay I'll take a look (-Status:Duplicate, +Status:Accepted)

gwtcoder: I can't repro this in 2.0.0.  Are you sure you're using the 2.0.0
RELEASE and not 2.0.0-rc1 or 2.0.0-ms2? (-Status:Accepted,
+Status:NeedsInfo)

uberuser: Doh!  You're right, I was using 2.0.0-rc1.  After upgrading to
2.0.0 RELEASE and recompiling, the problem went away.  Sorry, thanks!

gwtcoder: No prob, our version numbers are admittedly a bit confusing.
(-Status:NeedsInfo, +Status:Duplicate)

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



[gwt-contrib] Re: Prettier GWT version names for upcoming 2.0 releases

2009-08-13 Thread John Tamplin
On Thu, Aug 13, 2009 at 2:31 PM, Scott Blum  wrote:

> On Wed, Aug 12, 2009 at 6:39 PM, Bruce Johnson  wrote:
>
>> Senator Blum,
>>
>> Do you mean "disturbing" as in
>> 1) revolting,
>> 2) distressing, or
>> 3) disordering?
>>
>
> Distressing, I think.
>
> -- Example #1 --
>
> Please sort the following two lists chronlogically as quickly as you can:
>
> List 1: "1.6.2", "1.6.5", "1.6.0", "1.6.1"
>
> List 2: "2.0.0-rc2", "2.0.0-ms2", "2.0.0", "2.0.0-rc1"
>

The flipside of this argument, is identify the release versions in each
list.

-- Example #2 --
>
> uberuser: There's a bug in GWT where tab panels explode on FF3.
>
> gwtcoder: What version are you using?  I fixed that in 2.0.0.
>  (+Status:Duplicate)
>
> uberuser: I'm using 2.0.0 and it's still broken.
>
> gwtcoder: Okay I'll take a look (-Status:Duplicate, +Status:Accepted)
>
> gwtcoder: I can't repro this in 2.0.0.  Are you sure you're using the 2.0.0
> RELEASE and not 2.0.0-rc1 or 2.0.0-ms2? (-Status:Accepted,
> +Status:NeedsInfo)
>
> uberuser: Doh!  You're right, I was using 2.0.0-rc1.  After upgrading to
> 2.0.0 RELEASE and recompiling, the problem went away.  Sorry, thanks!
>
> gwtcoder: No prob, our version numbers are admittedly a bit confusing.
> (-Status:NeedsInfo, +Status:Duplicate)
>

I agree that has the potential to be a problem, but I would expect such a
user to report the full version number rather than truncating it.  Also, I
would expect them to try and upgrade to the released version before
reporting a problem (especially since we nag them every time once it is
released).

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

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



[gwt-contrib] Re: Prettier GWT version names for upcoming 2.0 releases

2009-08-13 Thread Kelly Norton
fwiw, I've never found myself sorting GWT distros but I do find myself
wanting to uniquely identify them all the time. Why do you think people will
be so eager to ignore part of the label? I would actually be surprised if
any form of naming fixes the few incidences of the conversation you mention.
I tend to think those are because people really do think they are using the
release ... only to realize later they never updated their project.
/kel

On Thu, Aug 13, 2009 at 2:31 PM, Scott Blum  wrote:

> On Wed, Aug 12, 2009 at 6:39 PM, Bruce Johnson  wrote:
>
>> Senator Blum,
>>
>> Do you mean "disturbing" as in
>> 1) revolting,
>> 2) distressing, or
>> 3) disordering?
>>
>
> Distressing, I think.
>
> -- Example #1 --
>
> Please sort the following two lists chronlogically as quickly as you can:
>
> List 1: "1.6.2", "1.6.5", "1.6.0", "1.6.1"
>
> List 2: "2.0.0-rc2", "2.0.0-ms2", "2.0.0", "2.0.0-rc1"
>
> -- Example #2 --
>
> uberuser: There's a bug in GWT where tab panels explode on FF3.
>
> gwtcoder: What version are you using?  I fixed that in 2.0.0.
>  (+Status:Duplicate)
>
> uberuser: I'm using 2.0.0 and it's still broken.
>
> gwtcoder: Okay I'll take a look (-Status:Duplicate, +Status:Accepted)
>
> gwtcoder: I can't repro this in 2.0.0.  Are you sure you're using the 2.0.0
> RELEASE and not 2.0.0-rc1 or 2.0.0-ms2? (-Status:Accepted,
> +Status:NeedsInfo)
>
> uberuser: Doh!  You're right, I was using 2.0.0-rc1.  After upgrading to
> 2.0.0 RELEASE and recompiling, the problem went away.  Sorry, thanks!
>
> gwtcoder: No prob, our version numbers are admittedly a bit confusing.
> (-Status:NeedsInfo, +Status:Duplicate)
>
>
> >
>


-- 
If you received this communication by mistake, you are entitled to one free
ice cream cone on me. Simply print out this email including all relevant
SMTP headers and present them at my desk to claim your creamy treat. We'll
have a laugh at my emailing incompetence, and play a game of ping pong.
(offer may not be valid in all States).

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



[gwt-contrib] Re: Prettier GWT version names for upcoming 2.0 releases

2009-08-13 Thread Isaac Truett

> -- Example #1 --
> Please sort the following two lists chronlogically as quickly as you can:
> List 1: "1.6.2", "1.6.5", "1.6.0", "1.6.1"
> List 2: "2.0.0-rc2", "2.0.0-ms2", "2.0.0", "2.0.0-rc1"

This should be trivial for anyone familiar with the concepts of
milestone and release candidate builds. Anyone not familiar with those
concepts shouldn't be using those builds, IMO. It's a little harder
for a computer but they don't mind doing the extra work, really.

My beef with the current system is that it doesn't clearly distinguish
between releases and candidates/milestones. May I propose the
following alternative for picking apart?

major.minor.bugfix.svn-revision.[rc|m|r]n

where 'r' denotes a release.

That would disambiguate and sort easily.


On Thu, Aug 13, 2009 at 2:31 PM, Scott Blum wrote:
> On Wed, Aug 12, 2009 at 6:39 PM, Bruce Johnson  wrote:
>>
>> Senator Blum,
>> Do you mean "disturbing" as in
>> 1) revolting,
>> 2) distressing, or
>> 3) disordering?
>
> Distressing, I think.
> -- Example #1 --
> Please sort the following two lists chronlogically as quickly as you can:
> List 1: "1.6.2", "1.6.5", "1.6.0", "1.6.1"
> List 2: "2.0.0-rc2", "2.0.0-ms2", "2.0.0", "2.0.0-rc1"
> -- Example #2 --
> uberuser: There's a bug in GWT where tab panels explode on FF3.
> gwtcoder: What version are you using?  I fixed that in 2.0.0.
>  (+Status:Duplicate)
> uberuser: I'm using 2.0.0 and it's still broken.
> gwtcoder: Okay I'll take a look (-Status:Duplicate, +Status:Accepted)
> gwtcoder: I can't repro this in 2.0.0.  Are you sure you're using the 2.0.0
> RELEASE and not 2.0.0-rc1 or 2.0.0-ms2? (-Status:Accepted,
> +Status:NeedsInfo)
> uberuser: Doh!  You're right, I was using 2.0.0-rc1.  After upgrading to
> 2.0.0 RELEASE and recompiling, the problem went away.  Sorry, thanks!
> gwtcoder: No prob, our version numbers are admittedly a bit confusing.
> (-Status:NeedsInfo, +Status:Duplicate)
>
> >
>

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



[gwt-contrib] Adding a DOM com.google.gwt.dom.client.Window class?

2009-08-13 Thread Matt Mastracci

Hi all,

I've been hacking around the lack of a true JavaScriptObject window in  
GWT for a while and I was wondering if there was any interest in me  
providing a patch for it.  While the current  
com.google.gwt.user.client.Window works for most cases, you aren't  
able to interact with other windows in the system without resorting to  
hand-rolled JSNI.  For example, calling  
com.google.gwt.user.client.Window::open() doesn't provide you a way to  
close the window that was just opened.

I propose adding a JSO subclass to the com.google.gwt.dom.client  
package.  For the first patch there would be a handful of  
uncontroversial methods on it (further patches could provide the  
remainder of the functionality that exists in the  
com.google.gwt.user.client.Window):

Document getDocument();
void alert(String);
String prompt(String);
void close();

I would also propose adding the following method to Document to get  
its associated window.  On standards-compliant browsers, this would  
map to "defaultView".  On IE, this would map to "parentWindow":

Window getParentWindow()

Thoughts?

Matt.

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



[gwt-contrib] Re: Prettier GWT version names for upcoming 2.0 releases

2009-08-13 Thread Scott Blum
On Thu, Aug 13, 2009 at 2:41 PM, Kelly Norton  wrote:

> fwiw, I've never found myself sorting GWT distros but I do find myself
> wanting to uniquely identify them all the time. Why do you think people will
> be so eager to ignore part of the label? I would actually be surprised if
> any form of naming fixes the few incidences of the conversation you mention.
> I tend to think those are because people really do think they are using the
> release ... only to realize later they never updated their project.
>

Heh, sorry, that was probably not the best way of making this point: I think
more obvious is usually better, because you don't have to think about it.
 This means less wasted time, and less chance of confusion.

Don't get me wrong, I'm not saying the current system is perfect or that we
shouldn't change it.  I'm sure there are better things than we're doing
right now, which might help with the problem of identifying a release vs. a
milestone or rc.  But I do think a system where the numeric portion of the
version is non-unique invites confusion.

What if we were more consistent with the parentheticals, like in the
GWT release
notes
?

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



[gwt-contrib] [google-web-toolkit] r5958 committed - Fixed small typo in JSNI method

2009-08-13 Thread codesite-noreply

Revision: 5958
Author: cromwellian
Date: Thu Aug 13 12:17:19 2009
Log: Fixed small typo in JSNI method



http://code.google.com/p/google-web-toolkit/source/detail?r=5958

Modified:
  /trunk/user/super/com/google/gwt/emul/java/util/Date.java

===
--- /trunk/user/super/com/google/gwt/emul/java/util/Date.java   Wed Jun 17  
17:28:21 2009
+++ /trunk/user/super/com/google/gwt/emul/java/util/Date.java   Thu Aug 13  
12:17:19 2009
@@ -292,7 +292,7 @@
  padTwo(d.getMinutes()) + ":" +
  padTwo(d.getSeconds()) +
  " GMT" + hourOffset + minuteOffset +
-+ " " + d.getFullYear();
+" " + d.getFullYear();
}-*/;

/**

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



[gwt-contrib] [google-web-toolkit] r5959 committed - Function Clustering, improves gzip compression by significant margin. ...

2009-08-13 Thread codesite-noreply

Revision: 5959
Author: cromwellian
Date: Thu Aug 13 12:21:36 2009
Log: Function Clustering, improves gzip compression by significant margin.  
Top-level block restructuring for IE7 is now done purely via a  
text-transformation, while in-method block restructuring is done via the  
AST. Block restructuring is only performed for IE permutations (or  
permutations with no user.agent specified).





http://code.google.com/p/google-web-toolkit/source/detail?r=5959

Added:
   
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsAbstractTextTransformer.java
  /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsFunctionClusterer.java
   
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsIEBlockTextTransformer.java
Modified:
  /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java

===
--- /dev/null
+++  
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsAbstractTextTransformer.java  
 
Thu Aug 13 12:21:36 2009
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+package com.google.gwt.dev.jjs.impl;
+
+import com.google.gwt.core.ext.linker.StatementRanges;
+import com.google.gwt.core.ext.linker.impl.StandardStatementRanges;
+
+import java.util.ArrayList;
+
+/**
+ * Base class for transforming program text.
+ */
+public abstract class JsAbstractTextTransformer {
+
+  protected String js;
+
+  protected StatementRanges statementRanges;
+
+  public JsAbstractTextTransformer(String js, StatementRanges  
statementRanges) {
+this.js = js;
+this.statementRanges = statementRanges;
+  }
+
+  public JsAbstractTextTransformer(JsAbstractTextTransformer xformer) {
+this.js = xformer.getJs();
+this.statementRanges = xformer.getStatementRanges();
+  }
+
+  public abstract void exec();
+
+  protected void addStatement(String code, StringBuilder newJs,
+  ArrayList starts, ArrayList ends) {
+beginStatement(newJs, starts);
+newJs.append(code);
+endStatement(newJs, ends);
+  }
+
+  protected void endStatement(StringBuilder newJs, ArrayList  
ends) {
+ends.add(newJs.length());
+  }
+
+  protected void beginStatement(StringBuilder newJs,
+  ArrayList starts) {
+starts.add(newJs.length());
+  }
+
+  public String getJs() {
+return js;
+  }
+
+  public StatementRanges getStatementRanges() {
+return statementRanges;
+  }
+
+  protected String getJsForRange(int stmtIndex) {
+return js.substring(statementRanges.start(stmtIndex),
+statementRanges.end(stmtIndex));
+  }
+
+  /**
+   * Dump functions and fragments back into a new JS string, and calculate  
a new
+   * StatementRanges object.
+   */
+  protected void recomputeJsAndStatementRanges(int[] stmtIndices) {
+
+StringBuilder newJs = new StringBuilder();
+ArrayList starts = new ArrayList();
+ArrayList ends = new ArrayList();
+
+beginStatements(newJs, starts, ends);
+for (int i = 0; i < stmtIndices.length; i++) {
+  String code = getJsForRange(stmtIndices[i]);
+  addStatement(code, newJs, starts, ends);
+}
+endStatements(newJs, starts, ends);
+
+assert
+starts.size() == ends.size() :
+"Size mismatch between start and" + " end statement ranges.";
+assert starts.get(0) == 0 && ends.get(ends.size() - 1) == newJs
+.length() : "statement ranges don't cover entire JS output  
string.";
+
+StandardStatementRanges newRanges = new StandardStatementRanges(starts,
+ends);
+js = newJs.toString();
+statementRanges = newRanges;
+  }
+
+  /**
+   * Called if any operations need to be performed before all statements  
have
+   * been processed.
+   */
+  protected void beginStatements(StringBuilder newJs, ArrayList  
starts,
+  ArrayList ends) {
+  }
+
+  /**
+   * Called if any operations need to be performed after all statements  
have
+   * been processed.
+   */
+  protected void endStatements(StringBuilder newJs, ArrayList  
starts,
+  ArrayList ends) {
+  }
+}
===
--- /dev/null
+++  
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsFunctionClusterer.java
 
Thu Aug 13 12:21:36 2009
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 

[gwt-contrib] [google-web-toolkit] r5960 committed - Added unary prefix '+' operator to AST to fix, Issue #3942. Modified J...

2009-08-13 Thread codesite-noreply

Revision: 5960
Author: cromwellian
Date: Thu Aug 13 12:24:26 2009
Log: Added unary prefix '+' operator to AST to fix, Issue #3942. Modified  
Js code-gen to insert spaces in appropriate places to maintain correct  
precedence. (e.g. a+ +b should not become a++b)





http://code.google.com/p/google-web-toolkit/source/detail?r=5960

Modified:
  /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java
  /trunk/dev/core/src/com/google/gwt/dev/js/JsToStringGenerationVisitor.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Wed Aug 12  
15:20:44 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Thu Aug 13  
12:24:26 2009
@@ -1197,8 +1197,13 @@
  return mapPrefixOperation(JsUnaryOperator.TYPEOF, unOp);

case TokenStream.ADD:
-// Pretend we didn't see it.
-return mapExpression(unOp.getFirstChild());
+if (unOp.getFirstChild().getType() != TokenStream.NUMBER) {
+  return mapPrefixOperation(JsUnaryOperator.POS, unOp);
+} else {
+  // Pretend we didn't see it.
+  return mapExpression(unOp.getFirstChild());
+}
+
case TokenStream.VOID:
  return mapPrefixOperation(JsUnaryOperator.VOID, unOp);

===
---  
/trunk/dev/core/src/com/google/gwt/dev/js/JsToStringGenerationVisitor.java  
 
Tue Jul  7 13:08:53 2009
+++  
/trunk/dev/core/src/com/google/gwt/dev/js/JsToStringGenerationVisitor.java  
 
Thu Aug 13 12:24:26 2009
@@ -1188,7 +1188,8 @@
JsOperator op2 = ((JsPrefixOperation) arg).getOperator();
return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG)
&& (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG)
-  || (op == JsBinaryOperator.ADD && op2 == JsUnaryOperator.INC);
+  || (op == JsBinaryOperator.ADD || op == JsUnaryOperator.POS)
+  && (op2 == JsUnaryOperator.INC || op2 == JsUnaryOperator.POS);
  }
  if (arg instanceof JsNumberLiteral) {
JsNumberLiteral literal = (JsNumberLiteral) arg;

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



[gwt-contrib] [google-web-toolkit] r5961 committed - Rollback to last green build, 5956

2009-08-13 Thread codesite-noreply

Revision: 5961
Author: rj...@google.com
Date: Thu Aug 13 12:43:26 2009
Log: Rollback to last green build, 5956


http://code.google.com/p/google-web-toolkit/source/detail?r=5961

Deleted:
   
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsAbstractTextTransformer.java
  /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsFunctionClusterer.java
   
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsIEBlockTextTransformer.java
Modified:
  /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
  /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java
  /trunk/dev/core/src/com/google/gwt/dev/js/JsToStringGenerationVisitor.java
   
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
  /trunk/user/super/com/google/gwt/emul/java/util/Date.java
   
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
  /trunk/user/test/com/google/gwt/user/client/rpc/CollectionsTest.java

===
---  
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsAbstractTextTransformer.java  
 
Thu Aug 13 12:21:36 2009
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
- * use this file except in compliance with the License. You may obtain a  
copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations  
under
- * the License.
- */
-package com.google.gwt.dev.jjs.impl;
-
-import com.google.gwt.core.ext.linker.StatementRanges;
-import com.google.gwt.core.ext.linker.impl.StandardStatementRanges;
-
-import java.util.ArrayList;
-
-/**
- * Base class for transforming program text.
- */
-public abstract class JsAbstractTextTransformer {
-
-  protected String js;
-
-  protected StatementRanges statementRanges;
-
-  public JsAbstractTextTransformer(String js, StatementRanges  
statementRanges) {
-this.js = js;
-this.statementRanges = statementRanges;
-  }
-
-  public JsAbstractTextTransformer(JsAbstractTextTransformer xformer) {
-this.js = xformer.getJs();
-this.statementRanges = xformer.getStatementRanges();
-  }
-
-  public abstract void exec();
-
-  protected void addStatement(String code, StringBuilder newJs,
-  ArrayList starts, ArrayList ends) {
-beginStatement(newJs, starts);
-newJs.append(code);
-endStatement(newJs, ends);
-  }
-
-  protected void endStatement(StringBuilder newJs, ArrayList  
ends) {
-ends.add(newJs.length());
-  }
-
-  protected void beginStatement(StringBuilder newJs,
-  ArrayList starts) {
-starts.add(newJs.length());
-  }
-
-  public String getJs() {
-return js;
-  }
-
-  public StatementRanges getStatementRanges() {
-return statementRanges;
-  }
-
-  protected String getJsForRange(int stmtIndex) {
-return js.substring(statementRanges.start(stmtIndex),
-statementRanges.end(stmtIndex));
-  }
-
-  /**
-   * Dump functions and fragments back into a new JS string, and calculate  
a new
-   * StatementRanges object.
-   */
-  protected void recomputeJsAndStatementRanges(int[] stmtIndices) {
-
-StringBuilder newJs = new StringBuilder();
-ArrayList starts = new ArrayList();
-ArrayList ends = new ArrayList();
-
-beginStatements(newJs, starts, ends);
-for (int i = 0; i < stmtIndices.length; i++) {
-  String code = getJsForRange(stmtIndices[i]);
-  addStatement(code, newJs, starts, ends);
-}
-endStatements(newJs, starts, ends);
-
-assert
-starts.size() == ends.size() :
-"Size mismatch between start and" + " end statement ranges.";
-assert starts.get(0) == 0 && ends.get(ends.size() - 1) == newJs
-.length() : "statement ranges don't cover entire JS output  
string.";
-
-StandardStatementRanges newRanges = new StandardStatementRanges(starts,
-ends);
-js = newJs.toString();
-statementRanges = newRanges;
-  }
-
-  /**
-   * Called if any operations need to be performed before all statements  
have
-   * been processed.
-   */
-  protected void beginStatements(StringBuilder newJs, ArrayList  
starts,
-  ArrayList ends) {
-  }
-
-  /**
-   * Called if any operations need to be performed after all statements  
have
-   * been processed.
-   */
-  protected void endStatements(StringBuilder newJs, ArrayList  
starts,
-  ArrayList ends) {
-  }
-}
===
---  
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsFunctionClusterer.java
 
Thu Aug 13 12:21:36 2009
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed un

[gwt-contrib] Re: add names to runAsync calls

2009-08-13 Thread scottb

CodeSplitter LGTM


http://gwt-code-reviews.appspot.com/56814/diff/1/9
File dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter.java (right):

http://gwt-code-reviews.appspot.com/56814/diff/1/9#newcode455
Line 455: if (splitPoints.size() != 1) {
Can splitPoints.size() == 0?  If not, testing "size() > 1" would better
convey intent.

http://gwt-code-reviews.appspot.com/56814

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



[gwt-contrib] Re: [google-web-toolkit] r5959 committed - Function Clustering, improves gzip compression by significant margin. ...

2009-08-13 Thread Matt Mastracci

Ray,

This is really cool!

On 13-Aug-09, at 1:22 PM, codesite-nore...@google.com wrote:

>
> Revision: 5959
> Author: cromwellian
> Date: Thu Aug 13 12:21:36 2009
> Log: Function Clustering, improves gzip compression by significant  
> margin.
> Top-level block restructuring for IE7 is now done purely via a
> text-transformation, while in-method block restructuring is done via  
> the
> AST. Block restructuring is only performed for IE permutations (or
> permutations with no user.agent specified).
>
>
>
>
>
> http://code.google.com/p/google-web-toolkit/source/detail?r=5959
>
> Added:
>
> /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ 
> JsAbstractTextTransformer.java
>  /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ 
> JsFunctionClusterer.java
>
> /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ 
> JsIEBlockTextTransformer.java
> Modified:
>  /trunk/dev/core/src/com/google/gwt/dev/jjs/ 
> JavaToJavaScriptCompiler.java
>
> ===
> --- /dev/null
> +++
> /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ 
> JsAbstractTextTransformer.java
> Thu Aug 13 12:21:36 2009
> @@ -0,0 +1,117 @@
> +/*
> + * Copyright 2009 Google Inc.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");  
> you may
> not
> + * use this file except in compliance with the License. You may  
> obtain a
> copy of
> + * the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,  
> software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT
> + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
> See the
> + * License for the specific language governing permissions and  
> limitations
> under
> + * the License.
> + */
> +package com.google.gwt.dev.jjs.impl;
> +
> +import com.google.gwt.core.ext.linker.StatementRanges;
> +import com.google.gwt.core.ext.linker.impl.StandardStatementRanges;
> +
> +import java.util.ArrayList;
> +
> +/**
> + * Base class for transforming program text.
> + */
> +public abstract class JsAbstractTextTransformer {
> +
> +  protected String js;
> +
> +  protected StatementRanges statementRanges;
> +
> +  public JsAbstractTextTransformer(String js, StatementRanges
> statementRanges) {
> +this.js = js;
> +this.statementRanges = statementRanges;
> +  }
> +
> +  public JsAbstractTextTransformer(JsAbstractTextTransformer  
> xformer) {
> +this.js = xformer.getJs();
> +this.statementRanges = xformer.getStatementRanges();
> +  }
> +
> +  public abstract void exec();
> +
> +  protected void addStatement(String code, StringBuilder newJs,
> +  ArrayList starts, ArrayList ends) {
> +beginStatement(newJs, starts);
> +newJs.append(code);
> +endStatement(newJs, ends);
> +  }
> +
> +  protected void endStatement(StringBuilder newJs, ArrayList
> ends) {
> +ends.add(newJs.length());
> +  }
> +
> +  protected void beginStatement(StringBuilder newJs,
> +  ArrayList starts) {
> +starts.add(newJs.length());
> +  }
> +
> +  public String getJs() {
> +return js;
> +  }
> +
> +  public StatementRanges getStatementRanges() {
> +return statementRanges;
> +  }
> +
> +  protected String getJsForRange(int stmtIndex) {
> +return js.substring(statementRanges.start(stmtIndex),
> +statementRanges.end(stmtIndex));
> +  }
> +
> +  /**
> +   * Dump functions and fragments back into a new JS string, and  
> calculate
> a new
> +   * StatementRanges object.
> +   */
> +  protected void recomputeJsAndStatementRanges(int[] stmtIndices) {
> +
> +StringBuilder newJs = new StringBuilder();
> +ArrayList starts = new ArrayList();
> +ArrayList ends = new ArrayList();
> +
> +beginStatements(newJs, starts, ends);
> +for (int i = 0; i < stmtIndices.length; i++) {
> +  String code = getJsForRange(stmtIndices[i]);
> +  addStatement(code, newJs, starts, ends);
> +}
> +endStatements(newJs, starts, ends);
> +
> +assert
> +starts.size() == ends.size() :
> +"Size mismatch between start and" + " end statement ranges.";
> +assert starts.get(0) == 0 && ends.get(ends.size() - 1) == newJs
> +.length() : "statement ranges don't cover entire JS output
> string.";
> +
> +StandardStatementRanges newRanges = new  
> StandardStatementRanges(starts,
> +ends);
> +js = newJs.toString();
> +statementRanges = newRanges;
> +  }
> +
> +  /**
> +   * Called if any operations need to be performed before all  
> statements
> have
> +   * been processed.
> +   */
> +  protected void beginStatements(StringBuilder newJs,  
> ArrayList
> starts,
> +  ArrayList ends) {
> +  }
> +
> +  /**
> +   * Called if any operations need to be performed after all  
> statements
> have
> +   * been processed.
> +   */
> +  protected void endStatements(StringBuilder newJs,  
> ArrayList
> starts,
> +  ArrayList ends) {
> +  }
> +}
> 

[gwt-contrib] [google-web-toolkit] r5963 committed - Re-introduces c5957, because the build succeeded with it.

2009-08-13 Thread codesite-noreply

Revision: 5963
Author: amitman...@google.com
Date: Thu Aug 13 14:09:05 2009
Log: Re-introduces c5957, because the build succeeded with it.


http://code.google.com/p/google-web-toolkit/source/detail?r=5963

Modified:
   
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
  /trunk/user/test/com/google/gwt/user/client/rpc/CollectionsTest.java

===
---  
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
Thu Aug 13 12:43:26 2009
+++  
/trunk/user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java
   
Thu Aug 13 14:09:05 2009
@@ -34,6 +34,54 @@
  Map_CustomFieldSerializerBase.deserialize(streamReader, instance);
}

+  /**
+   * Infers the value of the private accessOrder field of instance by  
examining
+   * its behavior on a set of test inputs, without using reflection. Note  
that
+   * this implementation clones the instance, which could be slow.
+   *
+   * @param instance the instance to check
+   * @return the value of instance.accessOrder
+   */
+  @SuppressWarnings("unchecked") // raw LinkedHashMap
+  public static boolean getAccessOrderNoReflection(LinkedHashMap instance)  
{
+/*
+ * Clone the instance so our modifications won't affect the original.
+ * In particular, if the original overrides removeEldestEntry, adding
+ * elements to the map could cause existing elements to be removed.
+ */
+instance = (LinkedHashMap) instance.clone();
+instance.clear();
+
+/*
+ * We insert key1, then key2, after which we access key1. We then  
iterate
+ * over the key set and observe the order in which keys are returned.  
The
+ * iterator will return keys in the order of least recent insertion or
+ * access, depending on the value of the accessOrder field within the
+ * LinkedHashMap instance. If the iterator is ordered by least recent
+ * insertion (accessOrder = false), we will encounter key1 first since  
key2
+ * has been inserted more recently. If it is ordered by least recent  
access
+ * (accessOrder = true), we will encounter key2 first, since key1 has  
been
+ * accessed more recently.
+ */
+Object key1 = new Object();
+Object key2 = new Object();
+instance.put(key1, key1); // INSERT key1
+instance.put(key2, key2); // INSERT key2
+instance.get(key1);   // ACCESS key1
+boolean accessOrder = false;
+for (Object key : instance.keySet()) {
+  if (key == key1) {
+break;
+  }
+  if (key == key2) {
+accessOrder = true;
+break;
+  }
+}
+
+return accessOrder;
+  }
+
@SuppressWarnings("unchecked") // raw LinkedHashMap
public static LinkedHashMap instantiate(SerializationStreamReader  
streamReader)
throws SerializationException {
@@ -49,21 +97,23 @@
}

@SuppressWarnings("unchecked") // raw LinkedHashMap
-  private static boolean getAccessOrder(LinkedHashMap instance)
-  throws SerializationException {
+  private static boolean getAccessOrder(LinkedHashMap instance) {
  Field accessOrderField;
  try {
accessOrderField =  
LinkedHashMap.class.getDeclaredField("accessOrder");
accessOrderField.setAccessible(true);
return ((Boolean) accessOrderField.get(instance)).booleanValue();
  } catch (SecurityException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (NoSuchFieldException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (IllegalArgumentException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
+  // fall through
  } catch (IllegalAccessException e) {
-  throw new SerializationException("Can't get accessOrder field", e);
-}
+  // fall through
+}
+
+// Use a (possibly slower) technique that does not require reflection.
+return getAccessOrderNoReflection(instance);
}
  }
===
---  
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java

Thu Aug 13 12:43:26 2009
+++  
/trunk/user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java

Thu Aug 13 14:09:05 2009
@@ -31,6 +31,12 @@
LinkedHashMap instance) throws SerializationException {
  Map_CustomFieldSerializerBase.deserialize(streamReader, instance);
}
+
+  @SuppressWarnings("unchecked") // raw LinkedHashMap
+  // Included for testability
+  public static boolean getAccessOrderNoReflection(LinkedHashMap instance

[gwt-contrib] [google-web-toolkit] r5964 committed - Delete obsolete source files.

2009-08-13 Thread codesite-noreply
Revision: 5964
Author: r...@google.com
Date: Thu Aug 13 14:19:09 2009
Log: Delete obsolete source files.


http://code.google.com/p/google-web-toolkit/source/detail?r=5964

Deleted:
  /trunk/user/src/com/google/gwt/user/rebind/rpc/ClientDataSerializer.java
   
/trunk/user/src/com/google/gwt/user/rebind/rpc/JdoDetachedStateClientDataSerializer.java
   
/trunk/user/src/com/google/gwt/user/server/rpc/impl/JdoDetachedStateServerDataSerializer.java
   
/trunk/user/src/com/google/gwt/user/server/rpc/impl/ServerDataSerializer.java

===
---  
/trunk/user/src/com/google/gwt/user/rebind/rpc/ClientDataSerializer.java
 
Mon Jul  6 12:56:52 2009
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
- * use this file except in compliance with the License. You may obtain a  
copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations  
under
- * the License.
- */
-package com.google.gwt.user.rebind.rpc;
-
-import com.google.gwt.core.ext.typeinfo.JClassType;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.TreeMap;
-
-/**
- * An interface for serializing and deserializing portions of Object data  
that
- * are present in the server implementation but are not present in client  
code.
- * For example, some persistence frameworks make use of server-side  
bytecode
- * enhancement; the fields added by such enhancement are unknown to the  
client,
- * and therefore are not handled by normal GWT RPC mechanisms.
- *
- * 
- * This portion of the interface is called from the
- * {...@link FieldSerializerCreator} as part of the generation of client-side  
field
- * serializers.
- *
- * @see com.google.gwt.user.server.rpc.impl.ServerDataSerializer
- */
-public abstract class ClientDataSerializer implements
-Comparable {
-
-  /**
-   * A mapping from ClientDataSerializer names to instances, sorted by  
name.
-   */
-  private static TreeMap serializers =
-new TreeMap();
-
-  /**
-   * All active ServerDataSerializers must be initialized here and placed  
into
-   * the serializers map.
-   *
-   * 
-   * The map must be kept in sync with the one in
-   * {...@link com.google.gwt.user.server.rpc.impl.ServerDataSerializer}.
-   */
-  static {
-// Load and register a JdoDetachedStateSerializer
-ClientDataSerializer serializer =  
JdoDetachedStateClientDataSerializer.getInstance();
-serializers.put(serializer.getName(), serializer);
-  }
-
-  /**
-   * Returns a Collection of all ClientDataSerializer instances, ordered  
by name.
-   * The returned collection is unmodifiable.
-   */
-  public static Collection getSerializers() {
-return Collections.unmodifiableCollection(serializers.values());
-  }
-
-  /**
-   * Allow ServerDataSerialzer instances to be sorted by class name.
-   */
-  public int compareTo(ClientDataSerializer other) {
-return getName().compareTo(other.getName());
-  }
-
-  /**
-   * Returns the name of this {...@link ServerDataSerializer} instance, used  
to
-   * determine the sorting order when multiple serializers apply to a given
-   * class type.  The name will be used as a key to store the serialized  
data
-   * on the client.
-   *
-   * 
-   * The name must be identical to that of the corresponding
-   * {...@link ServerDataSerializer}.
-   */
-  public abstract String getName();
-
-  /**
-   * Returns true if the given classType should be processed by a
-   * ServerClientSerializer.
-   *
-   * @param classType the class type to be queried.
-   */
-  public abstract boolean shouldSerialize(JClassType classType);
-}
===
---  
/trunk/user/src/com/google/gwt/user/rebind/rpc/JdoDetachedStateClientDataSerializer.java
 
Mon Jul  6 12:56:52 2009
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
- * use this file except in compliance with the License. You may obtain a  
copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations  
under
- * the License.
- */
-package com.google.gwt.user.rebind.rpc;
-
-import com.google.gwt.core.ext.typeinfo.JClassType;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTar

[gwt-contrib] Re: UiBinder and Model View Presenter

2009-08-13 Thread Amir Kashani
For my last work project, we used Kiyaa!, a GWT library that offers its own
declarative UI system (and data-binding). In addition, we used PureMVC as a
very lightweight MVC-framework. If you're familiar with PureMVC, you'll know
that it's much closer to MVP, as described by Ray Ryan, than it is a
traditional MVC framework. They worked beautifully together. Here's our
basic setup:

   - *Views *- these are the plain UI components represented with Kyiaa!
   templates. They're smart enough to display Model data and handle any UI
   interactions, but delegate all business logic to their Mediators. They have
   a Listener interface that is implemented by the Mediator, which has
   "high-level" callback methods, such as onRegister, onNewCustomer, etc rather
   than onClick.
   - *Mediator *- responsible for "managing" the views by facilitating
   communication between the View and the rest of the system. They send and
   receive Notifications that are handled by other Mediators or by Commands.
   More specifically, they provide model data to the View as it's available and
   handle user-triggered events from the view, etc. The mediators have NO
   references to any Widgets or other UI components. Their only interaction
   with the View is from callbacks through the defined interface and through
   the View's public API, which is generally fairly-high level as well. Because
   of this, it's easy to re-use UI components by having a different Mediator
   controlling the UI.


   - *Model* - these are your basic domain objects. They should be POJOs and
   have no concept of the rest of the system. Period.
   - *Proxy* - a Proxy's basic role is to provide a high-level API for
   managing the Model. Depending on the complexity of your domain object, it
   could be as simple as having methods such as addUser, deleteUser, etc. Or,
   for complex Models, such as a Word Document object, can have methods such as
   setTitle(), etc.

In our setup, Proxys take the former role, basically encapsulating all RPC
logic, implementing client-side caching, etc. You call methods on a Proxy,
such as saveUser, and it sends Notifications to the rest of the system when
something interesting happens. Proxy's NEVER receive notifications, however.
They are not interested in the rest of the system, including the UI (or even
that there is a UI), and theoretically, along with the models, should
function completely on their own, making them highly reusable.


   - *Command* - a Command is a place where you encode complex interactions.
   For example, if your application has a search function, you may have a
   SearchCommand that
  1. Receives the search query
  2. Calls the appropriate Proxy to do the RPC hit
  3. Loads the Mediator that will be interested in the Proxy's response,
  if not already loaded

The SearchCommand would be triggered by a notification sent from some
Mediator. The idea is to stick the logic into a re-usable Command rather
than encoding it into a Mediator directly, as it may be needed from multiple
places.


The great part about this design and MVP is, that if we want to switch to
UIBinder, all we have to do is modify the View classes. No other part of the
system would have to change one-bit.

Another quick note on PureMVC: it's kind of a disservice to it to call it an
MVC framework, as there's very little code involved in the "framework".
Rather, it's a set of concepts and principles that have been very well
defined, that if followed correctly, lead to highly-reusable and easily
testable components. Even if you don't use the framework, I highly recommend
reading their best practices:
http://puremvc.org/component/option,com_wrapper/Itemid,174/

- Amir

On Thu, Aug 13, 2009 at 2:27 AM, Andrés Testi wrote:

>
> How the UiBinder fits in the MVP architecture proposed at the google I/
> O talks? (http://code.google.com/intl/es-AR/events/io/sessions/
> GoogleWebToolkitBestPractices.html)
> Regards.
>
> - Andrés
> >
>

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



[gwt-contrib] [google-web-toolkit] r5965 committed - Fixes a problem where the compiler did not emit dependency information...

2009-08-13 Thread codesite-noreply

Revision: 5965
Author: sp...@google.com
Date: Thu Aug 13 14:40:09 2009
Log: Fixes a problem where the compiler did not emit dependency information
for programs with no calls to runAsync.

Review by: kprobst

http://code.google.com/p/google-web-toolkit/source/detail?r=5965

Modified:
   
/trunk/dev/core/src/com/google/gwt/core/ext/soyc/impl/DependencyRecorder.java
  /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java

===
---  
/trunk/dev/core/src/com/google/gwt/core/ext/soyc/impl/DependencyRecorder.java   
 
Mon Jul  6 21:44:11 2009
+++  
/trunk/dev/core/src/com/google/gwt/core/ext/soyc/impl/DependencyRecorder.java   
 
Thu Aug 13 14:40:09 2009
@@ -36,7 +36,7 @@
  public class DependencyRecorder implements MultipleDependencyGraphRecorder  
{
/**
 * DependencyRecorder is not allowed to throw checked exceptions,  
because if
-   * it did then {...@link CodeSplitter} and {...@link ControlFlowAnalyzer} 
would
+   * it did then {...@link com.google.gwt.dev.jjs.impl.CodeSplitter} and  
{...@link ControlFlowAnalyzer} would
 * throw exceptions all over the place. Instead, this class throws
 * NestedIOExceptions that wrap them.
 */
@@ -47,14 +47,11 @@
}

private final StringBuilder builder = new StringBuilder();
+  private final OutputStream finalOutput;
private OutputStreamWriter writer;

-  public DependencyRecorder(OutputStream out) throws IOException {
-try {
-  this.writer = new OutputStreamWriter(new  
GZIPOutputStream(out), "UTF-8");
-} catch (UnsupportedEncodingException e) {
-  throw new InternalCompilerException("UTF-8 is an unsupported  
encoding", e);
-}
+  public DependencyRecorder(OutputStream out) {
+this.finalOutput = out;
}

public void close() {
@@ -81,6 +78,15 @@
}

public void open() {
+try {
+  this.writer = new OutputStreamWriter(new  
GZIPOutputStream(finalOutput),
+  "UTF-8");
+} catch (UnsupportedEncodingException e) {
+  throw new InternalCompilerException("UTF-8 is an unsupported  
encoding", e);
+} catch (IOException e) {
+  throw new NestedIOException(e);
+}
+
  printPre();
}

===
---  
/trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
 
Thu Aug 13 12:43:26 2009
+++  
/trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
 
Thu Aug 13 14:40:09 2009
@@ -56,6 +56,7 @@
  import com.google.gwt.dev.jjs.impl.CastNormalizer;
  import com.google.gwt.dev.jjs.impl.CatchBlockNormalizer;
  import com.google.gwt.dev.jjs.impl.CodeSplitter;
+import com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer;
  import com.google.gwt.dev.jjs.impl.DeadCodeElimination;
  import com.google.gwt.dev.jjs.impl.EqualityNormalizer;
  import com.google.gwt.dev.jjs.impl.Finalizer;
@@ -136,9 +137,9 @@
private static class PermutationResultImpl implements PermutationResult {
  private final ArtifactSet artifacts = new ArtifactSet();
  private final byte[][] js;
+private final int permutationId;
  private final byte[] serializedSymbolMap;
  private final StatementRanges[] statementRanges;
-private final int permutationId;

  public PermutationResultImpl(String[] js, SymbolData[] symbolMap,
  StatementRanges[] statementRanges, int permutationId) {
@@ -287,6 +288,9 @@
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  CodeSplitter.exec(logger, jprogram, jsProgram, map,
  chooseDependencyRecorder(options.isSoycEnabled(), baos));
+if (baos.size() == 0 && options.isSoycEnabled()) {
+  recordNonSplitDependencies(jprogram, baos);
+}
  if (baos.size() > 0) {
dependencies = new SoycArtifact("dependencies" + permutationId
+ ".xml.gz", baos.toByteArray());
@@ -995,4 +999,27 @@
}
  }
}
-}
+
+  /**
+   * Dependency information is normally recorded during code splitting,  
and it
+   * results in multiple dependency graphs. If the code splitter doesn't  
run,
+   * then this method can be used instead to record a single dependency  
graph
+   * for the whole program.
+   */
+  private static void recordNonSplitDependencies(JProgram program,
+  OutputStream out) {
+DependencyRecorder deps = new DependencyRecorder(out);
+deps.open();
+deps.startDependencyGraph("initial", null);
+
+ControlFlowAnalyzer cfa = new ControlFlowAnalyzer(program);
+cfa.setDependencyRecorder(deps);
+for (List entryList : program.entryMethods) {
+  for (JMethod entry : entryList)
+cfa.traverseFrom(entry);
+}
+
+deps.endDependencyGraph();
+deps.close();
+  }
+}

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



[gwt-contrib] Re: add names to runAsync calls

2009-08-13 Thread spoon

Okay, now to redo the tests.


http://gwt-code-reviews.appspot.com/56814/diff/1/9
File dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter.java (right):

http://gwt-code-reviews.appspot.com/56814/diff/1/9#newcode455
Line 455: if (splitPoints.size() != 1) {
On 2009/08/13 19:50:17, scottb wrote:
> Can splitPoints.size() == 0?  If not, testing "size() > 1" would
better convey
> intent.

Done.

http://gwt-code-reviews.appspot.com/56814/diff/1/10
File dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
(right):

http://gwt-code-reviews.appspot.com/56814/diff/1/10#newcode107
Line 107: assert (x.getArgs().size() == 1 || x.getArgs().size() == 2);
On 2009/08/11 21:05:40, scottb wrote:
> This code might be a little more readable as a switch statement, and
you won't
> need the last() method; just throw an ICE on the default case.

Done.

http://gwt-code-reviews.appspot.com/56814

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



[gwt-contrib] Re: [google-web-toolkit] r5959 committed - Function Clustering, improves gzip compression by significant margin. ...

2009-08-13 Thread Ray Cromwell
There'll be a future blog post on the subject for sure, the improvement can
be up to 20% reduction in gzip size whe combining this and other techniques.

-Ray

On Thu, Aug 13, 2009 at 12:59 PM, Matt Mastracci wrote:

>
> Ray,
>
> This is really cool!
>
> On 13-Aug-09, at 1:22 PM, codesite-nore...@google.com wrote:
>
> >
> > Revision: 5959
> > Author: cromwellian
> > Date: Thu Aug 13 12:21:36 2009
> > Log: Function Clustering, improves gzip compression by significant
> > margin.
> > Top-level block restructuring for IE7 is now done purely via a
> > text-transformation, while in-method block restructuring is done via
> > the
> > AST. Block restructuring is only performed for IE permutations (or
> > permutations with no user.agent specified).
> >
> >
> >
> >
> >
> > http://code.google.com/p/google-web-toolkit/source/detail?r=5959
> >
> > Added:
> >
> > /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/
> > JsAbstractTextTransformer.java
> >  /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/
> > JsFunctionClusterer.java
> >
> > /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/
> > JsIEBlockTextTransformer.java
> > Modified:
> >  /trunk/dev/core/src/com/google/gwt/dev/jjs/
> > JavaToJavaScriptCompiler.java
> >
> > ===
> > --- /dev/null
> > +++
> > /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/
> > JsAbstractTextTransformer.java
> > Thu Aug 13 12:21:36 2009
> > @@ -0,0 +1,117 @@
> > +/*
> > + * Copyright 2009 Google Inc.
> > + *
> > + * Licensed under the Apache License, Version 2.0 (the "License");
> > you may
> > not
> > + * use this file except in compliance with the License. You may
> > obtain a
> > copy of
> > + * the License at
> > + *
> > + * http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing,
> > software
> > + * distributed under the License is distributed on an "AS IS" BASIS,
> > WITHOUT
> > + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> > See the
> > + * License for the specific language governing permissions and
> > limitations
> > under
> > + * the License.
> > + */
> > +package com.google.gwt.dev.jjs.impl;
> > +
> > +import com.google.gwt.core.ext.linker.StatementRanges;
> > +import com.google.gwt.core.ext.linker.impl.StandardStatementRanges;
> > +
> > +import java.util.ArrayList;
> > +
> > +/**
> > + * Base class for transforming program text.
> > + */
> > +public abstract class JsAbstractTextTransformer {
> > +
> > +  protected String js;
> > +
> > +  protected StatementRanges statementRanges;
> > +
> > +  public JsAbstractTextTransformer(String js, StatementRanges
> > statementRanges) {
> > +this.js = js;
> > +this.statementRanges = statementRanges;
> > +  }
> > +
> > +  public JsAbstractTextTransformer(JsAbstractTextTransformer
> > xformer) {
> > +this.js = xformer.getJs();
> > +this.statementRanges = xformer.getStatementRanges();
> > +  }
> > +
> > +  public abstract void exec();
> > +
> > +  protected void addStatement(String code, StringBuilder newJs,
> > +  ArrayList starts, ArrayList ends) {
> > +beginStatement(newJs, starts);
> > +newJs.append(code);
> > +endStatement(newJs, ends);
> > +  }
> > +
> > +  protected void endStatement(StringBuilder newJs, ArrayList
> > ends) {
> > +ends.add(newJs.length());
> > +  }
> > +
> > +  protected void beginStatement(StringBuilder newJs,
> > +  ArrayList starts) {
> > +starts.add(newJs.length());
> > +  }
> > +
> > +  public String getJs() {
> > +return js;
> > +  }
> > +
> > +  public StatementRanges getStatementRanges() {
> > +return statementRanges;
> > +  }
> > +
> > +  protected String getJsForRange(int stmtIndex) {
> > +return js.substring(statementRanges.start(stmtIndex),
> > +statementRanges.end(stmtIndex));
> > +  }
> > +
> > +  /**
> > +   * Dump functions and fragments back into a new JS string, and
> > calculate
> > a new
> > +   * StatementRanges object.
> > +   */
> > +  protected void recomputeJsAndStatementRanges(int[] stmtIndices) {
> > +
> > +StringBuilder newJs = new StringBuilder();
> > +ArrayList starts = new ArrayList();
> > +ArrayList ends = new ArrayList();
> > +
> > +beginStatements(newJs, starts, ends);
> > +for (int i = 0; i < stmtIndices.length; i++) {
> > +  String code = getJsForRange(stmtIndices[i]);
> > +  addStatement(code, newJs, starts, ends);
> > +}
> > +endStatements(newJs, starts, ends);
> > +
> > +assert
> > +starts.size() == ends.size() :
> > +"Size mismatch between start and" + " end statement ranges.";
> > +assert starts.get(0) == 0 && ends.get(ends.size() - 1) == newJs
> > +.length() : "statement ranges don't cover entire JS output
> > string.";
> > +
> > +StandardStatementRanges newRanges = new
> > StandardStatementRanges(starts,
> > +ends);
> > +js = newJs.toString();
> > +statementRanges = newRanges;
> > +  }
> > +
> > +  /**
> > +   *

[gwt-contrib] How to get JavaScriptObject$ class byte-code ?

2009-08-13 Thread Sami Jaber
Hi,
I would like to have a look at JavaScriptObject$ class which is used for the
overlay types.
This class is generated by the HostedModeClassRewriter with ASM routines ...
As .gwt-tmp has been removed, the new generated hosted mode classes are now
created in the temp folder with a new fancy format (Precompile.java seems to
indicate that it is a JAR but no way to get anything "readable" from this
file?)
It would be nice for debugging purpose (want to understand SingleJSOImpl in
terms of "internal implementation") to have a kind of -gen option for
classes that are created during the compilation process...
Sure you can help me ;-)

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



[gwt-contrib] Re: How to get JavaScriptObject$ class byte-code ?

2009-08-13 Thread John Tamplin
On Thu, Aug 13, 2009 at 7:20 PM, Sami Jaber  wrote:

> I would like to have a look at JavaScriptObject$ class which is used for
> the overlay types.
> This class is generated by the HostedModeClassRewriter with ASM routines
> ...
> As .gwt-tmp has been removed, the new generated hosted mode classes are now
> created in the temp folder with a new fancy format (Precompile.java seems to
> indicate that it is a JAR but no way to get anything "readable" from this
> file?)
> It would be nice for debugging purpose (want to understand SingleJSOImpl in
> terms of "internal implementation") to have a kind of -gen option for
> classes that are created during the compilation process...
> Sure you can help me ;-)
>

Set the Java system property gwt.dev.classDump to true, and then you can set
gwt.dev.classDumpPath to be the path to use instead of the default
(rewritten-classes in the directory the compiler is running from).

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

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



[gwt-contrib] Re: How to get JavaScriptObject$ class byte-code ?

2009-08-13 Thread Sami Jaber
Thanks a lot John.

On Fri, Aug 14, 2009 at 1:26 AM, John Tamplin  wrote:

> On Thu, Aug 13, 2009 at 7:20 PM, Sami Jaber  wrote:
>
>> I would like to have a look at JavaScriptObject$ class which is used for
>> the overlay types.
>> This class is generated by the HostedModeClassRewriter with ASM routines
>> ...
>> As .gwt-tmp has been removed, the new generated hosted mode classes are
>> now created in the temp folder with a new fancy format (Precompile.java
>> seems to indicate that it is a JAR but no way to get anything "readable"
>> from this file?)
>> It would be nice for debugging purpose (want to understand SingleJSOImpl
>> in terms of "internal implementation") to have a kind of -gen option for
>> classes that are created during the compilation process...
>> Sure you can help me ;-)
>>
>
> Set the Java system property gwt.dev.classDump to true, and then you can
> set gwt.dev.classDumpPath to be the path to use instead of the default
> (rewritten-classes in the directory the compiler is running from).
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>
> >
>

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



[gwt-contrib] Re: Rework emulated stack trace with conditional properties

2009-08-13 Thread Bruce Johnson
On Thu, Aug 13, 2009 at 12:55 PM,  wrote:

> @Bruce, does the following work for you?
>
>
>  
>
>
>  
>
>
>{
>  return location.search.indexOf('emulatedStack') != -1 ? 'true' :
> 'false';
>}
>


When you say, does it work for me, do you mean do I like it, or does it
literally run? I didn't run it (but can, if that's helpful), but I do like
the looks of it. It seems like exactly when I'd expect to see.

Reviewing the updated code now.

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



[gwt-contrib] Re: Rework emulated stack trace with conditional properties

2009-08-13 Thread bruce

LGTM, pending an LGTM on the other conditional property patch


http://gwt-code-reviews.appspot.com/56816/diff/1/6
File user/src/com/google/gwt/junit/JUnit.gwt.xml (right):

http://gwt-code-reviews.appspot.com/56816/diff/1/6#newcode34
Line 34: 
Probably want to remove this now?

http://gwt-code-reviews.appspot.com/56816/diff/1/6#newcode44
Line 44: 
To double-check, you're leaving these off because you  know that they
can already generate their own stack traces without emulation?

http://gwt-code-reviews.appspot.com/56816

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



[gwt-contrib] Re: DTO compiler optimization

2009-08-13 Thread Gary Miller

You might find this interesting, kind of related.

Generalized RPC for server-enhanced objects
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/1264556bab0906b6
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Clean up GWTCompiler output

2009-08-13 Thread Bruce Johnson
End this email below is what it looks like when I run the compiler on a
modified Hello sample using the default compiler log level. How is the
signal-to-noise ratio? I think it's not great.


A few areas for improvement:

- Lower the log level for "Creating Split Point Map file for SOYC"; seems
like this should be TRACE, since they don't actually have info that is
really context-relevant; it's more telling you what code path the compiler
itself is following; it might seem more useful if it listed the file name.

- Maybe get rid of ""Done"; the presence of subsequent outdented logs should
make it clear enough that the preceding step has finished

- Lower the log level of permutation timings to INFO

- Decide how to make the permutation counting look like it makes sense; in
particular, specifying " of ", you expect the indices to range 1..N
rather than 0..(N-1). Every time I see that last mesage "8 of 9" I keep
feeling disappointed that I never see "9 of 9" :-)

- Lower the log level of the "Linking" subtree, and specify what "war"
directory is being linked into, such as "Linking into war at
/usr/local/myproject/war"


Also, on another note, when you run the compiler with -treeLogger, we still
get some console noise that looks like this:

Permutation took 516 ms

Permutation took 284 ms

Permutation took 187 ms

Permutation took 147 ms

Permutation took 196 ms

Permutation took 131 ms

Permutation took 177 ms

Permutation took 140 ms

Permutation took 134 ms


I think we have a stray System.out?


In the end, it seems like the default log level ought to produce treelogger
output that looks like this:


Compiling module com.google.gwt.sample.hello.Hello

Compilation succeeded -- 6.889s

Arguably, it should even be silent unless there's a problem.

Thoughts? Anyone eager to write a patch for changes along these lines?

-- Bruce

=== Actual log below ===


Compiling module com.google.gwt.sample.hello.Hello

   Compiling 9 permutations

   Worker permutation 0 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 294 ms

   Worker permutation 1 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 291 ms

   Worker permutation 2 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 197 ms

   Worker permutation 3 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 154 ms

   Worker permutation 4 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 198 ms

   Worker permutation 5 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 194 ms

   Worker permutation 6 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 184 ms

   Worker permutation 7 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 145 ms

   Worker permutation 8 of 9

  Creating Split Point Map file for SOYC

 Done

Permutation took 131 ms

  Permutation compile succeeded

Linking into war

   Link succeeded

   Compilation succeeded -- 6.889s

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