[gwt-contrib] Re: Allow resource oracle to be expandable, speeds up client bundle in dev mode (issue1356801)

2011-02-11 Thread jbrosenberg

After discussing further with Scott, there's probably a better way to
solve this one.  Closing this review and retooling.

It turns out this does result in a significant savings in practice, for
projects with lots of ClientBundles with resources outside of the module
space.  So this approach will serve as an example solution for a
concrete problem.

But the solution should not alter the global ResourceOracle shared by
other unrelated generators.  However, question is whether keeping a
local resource oracle for use only by ClientBundles would not incur
significant overhead, since it would imply adding a mechanism for
maintaining extra framework for handling per-generator resource oracles,
and refreshing them, etc.

Toby's longer term proposal of adding a custom a indexing classloader
implementation is a more promising approach here, since circumventing a
slow class loader lookup would no longer be necessary, and things would
just work (assuming the classloader can be kept up to date
successfully).




http://gwt-code-reviews.appspot.com/1356801/diff/1/4
File
dev/core/src/com/google/gwt/dev/resource/impl/ExpandableResourceOracleImpl.java
(right):

http://gwt-code-reviews.appspot.com/1356801/diff/1/4#newcode28
dev/core/src/com/google/gwt/dev/resource/impl/ExpandableResourceOracleImpl.java:28:
public class ExpandableResourceOracleImpl extends ResourceOracleImpl
well, getPathPrefixes is public on ResourcesOracleImpl (but not
ResourcesOracle), so currently, generators don't have access to it.

http://gwt-code-reviews.appspot.com/1356801/diff/1/5
File user/src/com/google/gwt/resources/ext/ResourceGeneratorUtil.java
(right):

http://gwt-code-reviews.appspot.com/1356801/diff/1/5#newcode570
user/src/com/google/gwt/resources/ext/ResourceGeneratorUtil.java:570: if
(((GeneratorContextExt) genContext).isProdMode()) {
It's only dev mode, since the optimization depends on the initial
generator run discovering resource paths that caused a fallback to the
class loader, and then subsequent generator runs being able to take
advantage of the expanded resource oracle.  Generators don't run
multiple times for a given moduleSpace's ResourceOracle, in prodMode.

http://gwt-code-reviews.appspot.com/1356801/show

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


[gwt-contrib] [google-web-toolkit] r9727 committed - Added guava sources.

2011-02-11 Thread codesite-noreply

Revision: 9727
Author: gwt.mirror...@gmail.com
Date: Fri Feb 11 07:53:11 2011
Log: Added guava sources.
http://code.google.com/p/google-web-toolkit/source/detail?r=9727

Added:
 /tools/lib/guava/guava-r06/guava-r06-rebased-src.zip
 /tools/lib/guava/guava-r06/guava-r06-src.zip

===
--- /dev/null   
+++ /tools/lib/guava/guava-r06/guava-r06-rebased-src.zip	Fri Feb 11  
07:53:11 2011

Binary file, no diff available.
===
--- /dev/null   
+++ /tools/lib/guava/guava-r06/guava-r06-src.zipFri Feb 11 07:53:11 2011
Binary file, no diff available.

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


[gwt-contrib] Updated speed tracer logging for JDTCompiler, CompilationStateBuilder (issue1356802)

2011-02-11 Thread jbrosenberg

Reviewers: zundel,

Description:
Updated speed tracer logging for JDTCompiler, CompilationStateBuilder


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

Affected files:
  M dev/core/src/com/google/gwt/dev/javac/CompilationState.java
  M dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
  M dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
  M dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
  M  
dev/core/src/com/google/gwt/dev/util/log/speedtracer/CompilerEventType.java
  M  
dev/core/src/com/google/gwt/dev/util/log/speedtracer/DevModeEventType.java



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


[gwt-contrib] Re: Updated speed tracer logging for JDTCompiler, CompilationStateBuilder (issue1356802)

2011-02-11 Thread scottb

LGTM

http://gwt-code-reviews.appspot.com/1356802/show

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


[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread rchandia

ping
On 2011/02/09 15:22:04, rchandia wrote:

Removed the hibernate validation implementation as it is not

necessary.


I guess we need to decide between adding stuff to gwt-user.jar with

this

approach or to add the respective jars to each gwtc invocation as in:



http://gwt-code-reviews.appspot.com/1342803/show



On 2011/02/09 15:19:17, rchandia wrote:
>




http://gwt-code-reviews.appspot.com/1323803/show

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


[gwt-contrib] Re: Added validation jars to all calls to GWTC to provide classes rquired by (issue1342803)

2011-02-11 Thread rchandia

ping
On 2011/02/09 15:23:23, rchandia wrote:

On 2011/02/08 19:02:29, rjrjr wrote:
> Don't you need to make the same changes to samples/expenses/pom.xml?



Done.




http://gwt-code-reviews.appspot.com/1342803/show

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


[gwt-contrib] Re: Added validation jars to all calls to GWTC to provide classes rquired by (issue1342803)

2011-02-11 Thread nchalko

LGTM

http://gwt-code-reviews.appspot.com/1342803/show

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


[gwt-contrib] Re: Added validation jars to all calls to GWTC to provide classes rquired by (issue1342803)

2011-02-11 Thread nchalko

lgtm

http://gwt-code-reviews.appspot.com/1342803/show

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


[gwt-contrib] Re: Proactively gathers more method names for MethodArgNamesLookup. Before this (issue1359801)

2011-02-11 Thread zundel

http://gwt-code-reviews.appspot.com/1359801/show

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


[gwt-contrib] Re: Proactively gathers more method names for MethodArgNamesLookup. Before this (issue1359801)

2011-02-11 Thread zundel

updated patch


http://gwt-code-reviews.appspot.com/1359801/diff/1/3
File dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/1/3#newcode48
dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java:48: if
(declaringClass == null || declaringClass.isLocalType()) {
On 2011/02/11 00:22:54, scottb wrote:

Are the null guards defensive, or have you actually run into them?

Especially

the declaringClass == null seems like an assertion that it's not.


I only added the null test in after running the unit tests blew up on
me.  Its clints that have a null binding field.   checking
declaringClass is probably overkill.

http://gwt-code-reviews.appspot.com/1359801/diff/1/5
File dev/core/test/com/google/gwt/dev/javac/impl/JavaResourceBase.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/1/5#newcode269
dev/core/test/com/google/gwt/dev/javac/impl/JavaResourceBase.java:269:
public static final MockJavaResource METHOD_ARGS_TEST = new
MockJavaResource(
On 2011/02/11 00:22:54, scottb wrote:

Please move to CompilationStateTest.


Done.

http://gwt-code-reviews.appspot.com/1359801/diff/6002/7
File dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/6002/7#newcode22
dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java:22:
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
Not needed - removed locally.

http://gwt-code-reviews.appspot.com/1359801/show

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


[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Ray Ryan
I'm confused by your last comment, "I guess we need to decide...", which
points back to this issue. Who are you asking to choose between what?

On Fri, Feb 11, 2011 at 8:38 AM,  wrote:

> ping
>
> On 2011/02/09 15:22:04, rchandia wrote:
>
>> Removed the hibernate validation implementation as it is not
>>
> necessary.
>
>  I guess we need to decide between adding stuff to gwt-user.jar with
>>
> this
>
>> approach or to add the respective jars to each gwtc invocation as in:
>>
>
>  http://gwt-code-reviews.appspot.com/1342803/show
>>
>
>  On 2011/02/09 15:19:17, rchandia wrote:
>> >
>>
>
>
>
> http://gwt-code-reviews.appspot.com/1323803/show
>

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

[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Rodrigo Chandia
Oh, sorry. I guess I pasted confusingly similar links. So far there are two
approaches to fix Issue 5950:

http://gwt-code-reviews.appspot.com/1323803/show (This one)

http://gwt-code-reviews.appspot.com/1342803/show (The other one)

El 11 de febrero de 2011 12:48, Ray Ryan  escribió:

> I'm confused by your last comment, "I guess we need to decide...", which
> points back to this issue. Who are you asking to choose between what?
>
>
> On Fri, Feb 11, 2011 at 8:38 AM,  wrote:
>
>> ping
>>
>> On 2011/02/09 15:22:04, rchandia wrote:
>>
>>> Removed the hibernate validation implementation as it is not
>>>
>> necessary.
>>
>>  I guess we need to decide between adding stuff to gwt-user.jar with
>>>
>> this
>>
>>> approach or to add the respective jars to each gwtc invocation as in:
>>>
>>
>>  http://gwt-code-reviews.appspot.com/1342803/show
>>>
>>
>>  On 2011/02/09 15:19:17, rchandia wrote:
>>> >
>>>
>>
>>
>>
>> http://gwt-code-reviews.appspot.com/1323803/show
>>
>
>

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

[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Nick Chalko
On Fri, Feb 11, 2011 at 10:11 AM, Rodrigo Chandia wrote:

> Oh, sorry. I guess I pasted confusingly similar links. So far there are two
> approaches to fix Issue 5950:
>
> http://gwt-code-reviews.appspot.com/1323803/show (This one)
>
> http://gwt-code-reviews.appspot.com/1342803/show (The other one)
>
>
>
So adding to gwt-user  seems like the simplest approach

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

[gwt-contrib] Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread rjrjr

Reviewers: zundel,

Description:
Eclipse autoformatter update: allow assignments to wrap.


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

Affected files:
  M eclipse/settings/code-style/gwt-format.xml


Index: eclipse/settings/code-style/gwt-format.xml
===
--- eclipse/settings/code-style/gwt-format.xml  (revision 9726)
+++ eclipse/settings/code-style/gwt-format.xml  (working copy)
@@ -14,7 +14,7 @@
 id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"  
value="16"/>
 id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"  
value="16"/>
 id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"  
value="16"/>
-value="0"/>
+value="16"/>
 id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression"  
value="16"/>
 value="48"/>
 id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"  
value="16"/>



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


[gwt-contrib] Re: Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread rjrjr

It's like eating potato chips, once you start...

http://gwt-code-reviews.appspot.com/1354803/show

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


[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Rodrigo Chandia
El 11 de febrero de 2011 13:19, Nick Chalko  escribió:

>
>
> On Fri, Feb 11, 2011 at 10:11 AM, Rodrigo Chandia wrote:
>
>> Oh, sorry. I guess I pasted confusingly similar links. So far there are
>> two approaches to fix Issue 5950:
>>
>> http://gwt-code-reviews.appspot.com/1323803/show (This one)
>>
>> http://gwt-code-reviews.appspot.com/1342803/show (The other one)
>>
>>
>>
> So adding to gwt-user  seems like the simplest approach
>

Correct, but doing so could cause problems for someone trying to use their
own validation classes (say version 1.0.1-GA with a small bug fix), right?
That is why Ray commented above that this approach could bring Maven wrath
upon us. I tried our expenses sample with Maven and Eclipse, but that as far
as I can go with Maven given my lack of Maven-fu (white belt still).

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

[gwt-contrib] [google-web-toolkit] r9728 committed - Updated speed tracer logging for JDTCompiler, CompilationStateBuilder...

2011-02-11 Thread codesite-noreply

Revision: 9728
Author: gwt.mirror...@gmail.com
Date: Fri Feb 11 07:11:32 2011
Log: Updated speed tracer logging for JDTCompiler, CompilationStateBuilder

Review at http://gwt-code-reviews.appspot.com/1356802

Review by: zun...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9728

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
 /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
  
/trunk/dev/core/src/com/google/gwt/dev/util/log/speedtracer/CompilerEventType.java
  
/trunk/dev/core/src/com/google/gwt/dev/util/log/speedtracer/DevModeEventType.java


===
--- /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java	Wed  
Dec 15 07:54:33 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java	Fri  
Feb 11 07:11:32 2011

@@ -52,12 +52,12 @@
   private final CompileMoreLater compileMoreLater;

   /**
-   * Unmodifiable view of {@link #classFileMap).
+   * Unmodifiable view of {@link #classFileMap}.
*/
   private final Map exposedClassFileMap =  
Collections.unmodifiableMap(classFileMap);


   /**
-   * Unmodifiable view of {@link #classFileMapBySource).
+   * Unmodifiable view of {@link #classFileMapBySource}.
*/
   private final Map exposedClassFileMapBySource =  
Collections.unmodifiableMap(classFileMapBySource);


@@ -85,8 +85,7 @@
   public void addGeneratedCompilationUnits(TreeLogger logger,
   Collection generatedUnits) {
 Event generatedUnitsAddEvent = SpeedTracerLogger.start(
-DevModeEventType.GENERATED_UNITS_ADD);
-
+DevModeEventType.COMP_STATE_ADD_GENERATED_UNITS);
 try {
   logger = logger.branch(TreeLogger.DEBUG, "Adding '"
   + generatedUnits.size() + "' new generated units");
===
---  
/trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java	 
Wed Feb  9 10:04:25 2011
+++  
/trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java	 
Fri Feb 11 07:11:32 2011

@@ -24,9 +24,11 @@
 import com.google.gwt.dev.js.ast.JsRootScope;
 import com.google.gwt.dev.resource.Resource;
 import com.google.gwt.dev.util.StringInterner;
+import com.google.gwt.dev.util.log.speedtracer.CompilerEventType;
 import com.google.gwt.dev.util.log.speedtracer.DevModeEventType;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
+import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.EventType;

 import org.apache.commons.collections.map.AbstractReferenceMap;
 import org.apache.commons.collections.map.ReferenceIdentityMap;
@@ -63,7 +65,7 @@

   public void process(CompilationUnitBuilder builder,
   CompilationUnitDeclaration cud, List  
compiledClasses) {
-Event compilationStateBuilderProcess =  
SpeedTracerLogger.start(DevModeEventType.COMPILATION_STATE_BUILDER_PROCESS);
+Event event =  
SpeedTracerLogger.start(DevModeEventType.CSB_PROCESS);

 try {
   Map jsniMethods =  
JsniCollector.collectJsniMethods(

   cud, builder.getSource(), JsRootScope.INSTANCE,
@@ -128,7 +130,7 @@
   }
   newlyBuiltUnits.add(unit);
 } finally {
-  compilationStateBuilderProcess.end();
+  event.end();
 }
   }
 }
@@ -159,11 +161,12 @@

 public Collection addGeneratedTypes(TreeLogger logger,
 Collection generatedUnits) {
-  Event compilationStateBuilderProcess =  
SpeedTracerLogger.start(DevModeEventType.COMPILATION_STATE_BUILDER_PROCESS);

+  Event event =
+SpeedTracerLogger.start(DevModeEventType.CSB_ADD_GENERATED_TYPES);
   try {
 return doBuildGeneratedTypes(logger, generatedUnits, this);
   } finally {
-compilationStateBuilderProcess.end();
+event.end();
   }
 }

@@ -181,7 +184,8 @@

 Collection compile(TreeLogger logger,
 Collection builders,
-Map cachedUnits) {
+Map cachedUnits,
+EventType eventType) {
   // Initialize the set of valid classes to the initially cached units.
   for (CompilationUnit unit : cachedUnits.values()) {
 for (CompiledClass cc : unit.getCompiledClasses()) {
@@ -196,8 +200,14 @@
   do {
 // Compile anything that needs to be compiled.
 this.newlyBuiltUnits = new ArrayList();
-
-compiler.doCompile(builders);
+
+Event jdtCompilerEvent = SpeedTracerLogger.start(eventType);
+try {
+  compiler.doCompile(builders);
+} finally {
+  jdtCompilerEvent.end();
+}
+
 resultUnits.addAll(this.newlyBuiltUnits);
 builders.clear();

@@ -276,21 +286,21 @@

   public static CompilationState buildFrom(TreeLogger logger,
   Set resources) {
-Eve

[gwt-contrib] Re: Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread zundel

Well, I personally like the way it looks:

 this.myPackage = StringInterner.get().intern(
 (myPackage.length() == 0) ? "" : (myPackage + '.'));

becomes:

 this.myPackage =
 StringInterner.get().intern(
 (myPackage.length() == 0) ? "" : (myPackage + '.'));

This is going to cause a lot of churn...


http://gwt-code-reviews.appspot.com/1354803/show

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


[gwt-contrib] Re: Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread pdr

On 2011/02/11 18:51:18, zundel wrote:

Well, I personally like the way it looks:



  this.myPackage = StringInterner.get().intern(
  (myPackage.length() == 0) ? "" : (myPackage + '.'));



becomes:



  this.myPackage =
  StringInterner.get().intern(
  (myPackage.length() == 0) ? "" : (myPackage + '.'));



This is going to cause a lot of churn...


Would it be reasonable to format the entire source tree at once, and
have a single distasteful SVN commit?

http://gwt-code-reviews.appspot.com/1354803/show

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


Re: [gwt-contrib] Re: Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread John Tamplin
On Fri, Feb 11, 2011 at 1:51 PM,  wrote:

> Well, I personally like the way it looks:
>
>  this.myPackage = StringInterner.get().intern(
> (myPackage.length() == 0) ? "" : (myPackage + '.'));
>
> becomes:
>
>  this.myPackage =
> StringInterner.get().intern(
> (myPackage.length() == 0) ? "" : (myPackage + '.'));
>
> This is going to cause a lot of churn...


I would prefer wrapping assignments only when it is necessary to fit on the
line.  Ie, this example, the first version is better (and has the advantage
of being the way the source is now).  The real problem with assignments is
when they are really long, such as field initializers, and Eclipse won't
break them at all.

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

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

[gwt-contrib] Re: Proactively gathers more method names for MethodArgNamesLookup. Before this (issue1359801)

2011-02-11 Thread jbrosenberg

LGTM + nits


http://gwt-code-reviews.appspot.com/1359801/diff/6002/7
File dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/6002/7#newcode39
dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java:39: *
visible in the TypeOracle.
Maybe it's obvious, but I'm not sure I understand why a method with a
binding to a local type, makes it not visible in type oracle (perhaps
add another sentence explaining here?) (or at least elucidate me!)

http://gwt-code-reviews.appspot.com/1359801/diff/6002/8
File dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/6002/8#newcode222
dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java:222:
80 chars?

http://gwt-code-reviews.appspot.com/1359801/show

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


[gwt-contrib] Re: Proactively gathers more method names for MethodArgNamesLookup. Before this (issue1359801)

2011-02-11 Thread zundel


http://gwt-code-reviews.appspot.com/1359801/diff/6002/7
File dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java
(right):

http://gwt-code-reviews.appspot.com/1359801/diff/6002/7#newcode39
dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java:39: *
visible in the TypeOracle.
On 2011/02/11 18:59:11, jbrosenberg wrote:

Maybe it's obvious, but I'm not sure I understand why a method with a

binding to

a local type, makes it not visible in type oracle (perhaps add another

sentence

explaining here?) (or at least elucidate me!)


Toby and I just went through this the other day - its only obvious to
the student of the JLS (section 14.3 for reference).  A Local class has
a special meaning.  Its a nested class, but is not a member of  any
class - which means there is no way to refer to it outside that block of
code it was declared in.

  void myMethod() {
class myLocalClass() {
  int add(int a, int b) { return a + b; }
}
...
   }

 Since you can't refer to myLocalClass outside of the local scope
defined by myMethod they type oracle has no interest in it.

http://gwt-code-reviews.appspot.com/1359801/show

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


Re: [gwt-contrib] Re: Eclipse autoformatter update: allow assignments to wrap. (issue1354803)

2011-02-11 Thread Ray Ryan
I can't find a way to weight the line breaks, to make it resort to
assignments last. I'll drop this one.

On Fri, Feb 11, 2011 at 10:57 AM, John Tamplin  wrote:

> On Fri, Feb 11, 2011 at 1:51 PM,  wrote:
>
>> Well, I personally like the way it looks:
>>
>>  this.myPackage = StringInterner.get().intern(
>> (myPackage.length() == 0) ? "" : (myPackage + '.'));
>>
>> becomes:
>>
>>  this.myPackage =
>> StringInterner.get().intern(
>> (myPackage.length() == 0) ? "" : (myPackage + '.'));
>>
>> This is going to cause a lot of churn...
>
>
> I would prefer wrapping assignments only when it is necessary to fit on the
> line.  Ie, this example, the first version is better (and has the advantage
> of being the way the source is now).  The real problem with assignments is
> when they are really long, such as field initializers, and Eclipse won't
> break them at all.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>

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

[gwt-contrib] [google-web-toolkit] r9729 committed - Added antcount jars

2011-02-11 Thread codesite-noreply

Revision: 9729
Author: gwt.mirror...@gmail.com
Date: Fri Feb 11 11:37:16 2011
Log: Added antcount jars
http://code.google.com/p/google-web-toolkit/source/detail?r=9729

Added:
 /tools/antlib/COPYING.antcount
 /tools/antlib/antcount-1.2-src.jar
 /tools/antlib/antcount-1.2.jar

===
--- /dev/null
+++ /tools/antlib/COPYING.antcount  Fri Feb 11 11:37:16 2011
@@ -0,0 +1,146 @@
+GNU Lesser General Public License
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple  
Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy  
and distribute verbatim copies of this license document, but changing it is  
not allowed.

+
+[This is the first released version of the Lesser GPL. It also counts  
as the successor of the GNU Library Public License, version 2, hence the  
version number 2.1.]

+
+Preamble
+
+The licenses for most software are designed to take away your freedom to  
share and change it. By contrast, the GNU General Public Licenses are  
intended to guarantee your freedom to share and change free software--to  
make sure the software is free for all its users.

+
+This license, the Lesser General Public License, applies to some specially  
designated software packages--typically libraries--of the Free Software  
Foundation and other authors who decide to use it. You can use it too, but  
we suggest you first think carefully about whether this license or the  
ordinary General Public License is the better strategy to use in any  
particular case, based on the explanations below.

+
+When we speak of free software, we are referring to freedom of use, not  
price. Our General Public Licenses are designed to make sure that you have  
the freedom to distribute copies of free software (and charge for this  
service if you wish); that you receive source code or can get it if you  
want it; that you can change the software and use pieces of it in new free  
programs; and that you are informed that you can do these things.

+
+To protect your rights, we need to make restrictions that forbid  
distributors to deny you these rights or to ask you to surrender these  
rights. These restrictions translate to certain responsibilities for you if  
you distribute copies of the library or if you modify it.

+
+For example, if you distribute copies of the library, whether gratis or  
for a fee, you must give the recipients all the rights that we gave you.  
You must make sure that they, too, receive or can get the source code. If  
you link other code with the library, you must provide complete object  
files to the recipients, so that they can relink them with the library  
after making changes to the library and recompiling it. And you must show  
them these terms so they know their rights.

+
+We protect your rights with a two-step method: (1) we copyright the  
library, and (2) we offer you this license, which gives you legal  
permission to copy, distribute and/or modify the library.

+
+To protect each distributor, we want to make it very clear that there is  
no warranty for the free library. Also, if the library is modified by  
someone else and passed on, the recipients should know that what they have  
is not the original version, so that the original author's reputation will  
not be affected by problems that might be introduced by others.

+
+Finally, software patents pose a constant threat to the existence of any  
free program. We wish to make sure that a company cannot effectively  
restrict the users of a free program by obtaining a restrictive license  
from a patent holder. Therefore, we insist that any patent license obtained  
for a version of the library must be consistent with the full freedom of  
use specified in this license.

+
+Most GNU software, including some libraries, is covered by the ordinary  
GNU General Public License. This license, the GNU Lesser General Public  
License, applies to certain designated libraries, and is quite different  
from the ordinary General Public License. We use this license for certain  
libraries in order to permit linking those libraries into non-free programs.

+
+When a program is linked with a library, whether statically or using a  
shared library, the combination of the two is legally speaking a combined  
work, a derivative of the original library. The ordinary General Public  
License therefore permits such linking only if the entire combination fits  
its criteria of freedom. The Lesser General Public License permits more lax  
criteria for linking other code with the library.

+
+We call this license the "Lesser" General Public License because it does  
Less to protect the user's freedom than the ordinary General Public  
License. It also provides other free software developers Less of an  
advantage over competing non-free programs. These disadvantages are the  
reason we use the ordinary General Public License for many libraries.  
However, the 

[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Ray Ryan
If Dave has already LGTM'd one of the approaches as maven friendly, is there
any reason not to go with that? What are the trade offs?

On Fri, Feb 11, 2011 at 10:39 AM, Rodrigo Chandia wrote:

> El 11 de febrero de 2011 13:19, Nick Chalko  escribió:
>
>
>>
>> On Fri, Feb 11, 2011 at 10:11 AM, Rodrigo Chandia wrote:
>>
>>> Oh, sorry. I guess I pasted confusingly similar links. So far there are
>>> two approaches to fix Issue 5950:
>>>
>>> http://gwt-code-reviews.appspot.com/1323803/show (This one)
>>>
>>> http://gwt-code-reviews.appspot.com/1342803/show (The other one)
>>>
>>>
>>>
>> So adding to gwt-user  seems like the simplest approach
>>
>
> Correct, but doing so could cause problems for someone trying to use their
> own validation classes (say version 1.0.1-GA with a small bug fix), right?
> That is why Ray commented above that this approach could bring Maven wrath
> upon us. I tried our expenses sample with Maven and Eclipse, but that as far
> as I can go with Maven given my lack of Maven-fu (white belt still).
>

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

[gwt-contrib] Re: Proactively gathers more method names for MethodArgNamesLookup. Before this (issue1359801)

2011-02-11 Thread scottb

LGTM

http://gwt-code-reviews.appspot.com/1359801/show

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


[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Rodrigo Chandia
El 11 de febrero de 2011 14:48, Ray Ryan  escribió:

> If Dave has already LGTM'd one of the approaches as maven friendly, is
> there any reason not to go with that? What are the trade offs?


No LGTM from David Chandler yet.

But aside from that, from what David and I have discussed, both approaches
are Maven friendly. The only remaining points of discussion seem to be
maintainability and possible (yet unknown) conflicts with external versions
of  the validation API jars. Bundling the classes as done here forces every
GWT user to compile with our version of javax.validation (so far the only
one AFICT, and the user can still use any implementation on the server).

The other Issue (1342803) touches more places in our ant build, but keep the
validation jars separate and thus allow our users to easily choose to use
other validation APIs (as long as the API is backwards compatible with
validation-api-1.0.0.GA).

I personally believe in modularity and de-bundling, so I lean toward the
later option (Issue 1342803). In any case I'd be happy with either an LGTM
here (issue1323803) from David or an unopposed LGTM in issue1342803.

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

[gwt-contrib] Re: Added validation jars to all calls to GWTC to provide classes rquired by (issue1342803)

2011-02-11 Thread rjrjr

LGTM

http://gwt-code-reviews.appspot.com/1342803/show

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


[gwt-contrib] Re: Added missing validation jars to gwt-user.jar. Fixes Issue 5950. (issue1323803)

2011-02-11 Thread Ray Ryan
I was *convinced* those two numbers were the same. Dueling 803's!

I agree, the de-bundled one smells a lot better. LGTM'd it.

On Fri, Feb 11, 2011 at 12:11 PM, Rodrigo Chandia wrote:

> El 11 de febrero de 2011 14:48, Ray Ryan  escribió:
>
> If Dave has already LGTM'd one of the approaches as maven friendly, is
>> there any reason not to go with that? What are the trade offs?
>
>
> No LGTM from David Chandler yet.
>
> But aside from that, from what David and I have discussed, both approaches
> are Maven friendly. The only remaining points of discussion seem to be
> maintainability and possible (yet unknown) conflicts with external versions
> of  the validation API jars. Bundling the classes as done here forces every
> GWT user to compile with our version of javax.validation (so far the only
> one AFICT, and the user can still use any implementation on the server).
>
> The other Issue (1342803) touches more places in our ant build, but keep
> the validation jars separate and thus allow our users to easily choose to
> use other validation APIs (as long as the API is backwards compatible with
> validation-api-1.0.0.GA).
>
> I personally believe in modularity and de-bundling, so I lean toward the
> later option (Issue 1342803). In any case I'd be happy with either an LGTM
> here (issue1323803) from David or an unopposed LGTM in issue1342803.
>

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

[gwt-contrib] [google-web-toolkit] r9730 committed - Proactively gathers more method names for MethodArgNamesLookup. Befor...

2011-02-11 Thread codesite-noreply

Revision: 9730
Author: zun...@google.com
Date: Fri Feb 11 10:29:39 2011
Log: Proactively gathers more method names for MethodArgNamesLookup.   
Before this
logic was only interested in abstract methods.  Now it collects any non  
local methods

with at least one argument.

Review at http://gwt-code-reviews.appspot.com/1359801

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

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java
 /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java	 
Thu Sep 23 07:20:47 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java	 
Fri Feb 11 10:29:39 2011

@@ -22,6 +22,7 @@

 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;

+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;

@@ -29,7 +30,7 @@
  * Keeps track of method argument names that cannot be read from just the
  * bytecode.
  */
-public class MethodArgNamesLookup {
+public class MethodArgNamesLookup implements Serializable {

   private Map methodArgs;

@@ -97,4 +98,19 @@
 String key = StringInterner.get().intern(buf.toString());
 methodArgs.put(key, argNames);
   }
-}
+
+  /**
+   * For Unit Testing: returns an array of methods with arguments.
+   */
+  String[] getMethods() {
+return methodArgs.keySet().toArray(new String[0]);
+  }
+
+  /**
+   * For Unit Testing: returns an array of argument names for the specified
+   * method.
+   */
+  String[] lookup(String methodName) {
+return methodArgs.get(methodName);
+  }
+}
===
--- /trunk/dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java	 
Wed Feb  9 10:04:25 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/MethodParamCollector.java	 
Fri Feb 11 10:29:39 2011

@@ -18,6 +18,7 @@
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;

 /**
  * Collects method parameter names.
@@ -32,10 +33,20 @@
   this.methodArgs = methodArgs;
 }

+/**
+ * Collect information on methods with at least one argument that will  
be

+ * visible in the TypeOracle.
+ */
 @Override
 protected boolean interestingMethod(AbstractMethodDeclaration method) {
-  return method.arguments != null && method.arguments.length > 0
-  && method.isAbstract();
+  if (method.arguments == null || method.arguments.length == 0) {
+return false;
+  }
+  MethodBinding binding = method.binding;
+  if (binding == null || binding.declaringClass.isLocalType()) {
+return false;
+  }
+  return true;
 }

 @Override
===
--- /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java	 
Mon Aug 30 09:54:26 2010
+++ /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java	 
Fri Feb 11 10:29:39 2011

@@ -20,6 +20,7 @@
 import com.google.gwt.dev.javac.impl.MockResourceOracle;
 import com.google.gwt.dev.javac.impl.TweakedMockJavaResource;

+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -74,7 +75,7 @@
 testCaching(JavaResourceBase.FOO);
   }

-  /* test that mutiple generated units, if unchanged, are reused */
+  /* test that multiple generated units, if unchanged, are reused */
   public void testCachingOfMultipleUnits() {
 testCaching(JavaResourceBase.BAR, JavaResourceBase.FOO);
   }
@@ -218,6 +219,55 @@
 assertNotNull(newBar);
 assertNotSame(oldBar, newBar);
   }
+
+  public void testMethodArgs() {
+MockJavaResource resource = new  
MockJavaResource("test.MethodArgsTest") {

+  @Override
+  protected CharSequence getContent() {
+StringBuffer code = new StringBuffer();
+code.append("package test;\n");
+code.append("public abstract class MethodArgsTest {\n");
+code.append("  public abstract void anAbstractMethod(String  
aArg1);\n");
+code.append("  public native void aNativeMethod(String nArg1, int  
nArg2);\n");
+code.append("  public void aMethod(String mArg1, int mArg2, char  
mArg3) {}\n");

+code.append("  public void aNoArgMethod() {}\n");
+code.append("}\n");
+return code;
+  }
+};
+
+validateCompilationState();
+oracle.add(resource);
+rebuildCompilationState();
+validateCompilationState();
+Map unitMap = state.getCompilationUnitMap();
+MethodArgNamesLookup methodArgs =  
unitMap.get(Shared.getTypeName(resource)).getMethodArgs();

+String[] methods = methodArgs.getMet

[gwt-contrib] [google-web-toolkit] r9731 committed - Added validation jars to all calls to GWTC to provide classes rquired ...

2011-02-11 Thread codesite-noreply

Revision: 9731
Author: rchan...@google.com
Date: Fri Feb 11 11:12:39 2011
Log: Added validation jars to all calls to GWTC to provide classes rquired  
by

client-side validation. Fixes Issue 5950.

Review at http://gwt-code-reviews.appspot.com/1342803

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

Modified:
 /trunk/distro-source/build.xml
 /trunk/samples/common.ant.xml
 /trunk/samples/expenses/pom.xml
 /trunk/tools/benchmark-viewer/build.xml
 /trunk/user/src/com/google/gwt/user/tools/.classpathsrc
 /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java
 /trunk/user/src/com/google/gwt/user/tools/project.ant.xmlsrc

===
--- /trunk/distro-source/build.xml  Fri Oct 22 10:36:00 2010
+++ /trunk/distro-source/build.xml  Fri Feb 11 11:12:39 2011
@@ -30,6 +30,10 @@
   
   prefix="${project.distname}" />


+  
+  file="${gwt.tools}/lib/javax/validation/validation-api-1.0.0.GA.jar"  
prefix="${project.distname}" />
+  file="${gwt.tools}/lib/javax/validation/validation-api-1.0.0.GA-sources.jar"  
prefix="${project.distname}" />

+
   
   
   
===
--- /trunk/samples/common.ant.xml   Mon Dec 20 11:43:41 2010
+++ /trunk/samples/common.ant.xml   Fri Feb 11 11:12:39 2011
@@ -103,6 +103,8 @@
   />

   
   
+  location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
+  location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar"  
/>

 
 
 
===
--- /trunk/samples/expenses/pom.xml Tue Feb  8 11:03:03 2011
+++ /trunk/samples/expenses/pom.xml Fri Feb 11 11:12:39 2011
@@ -226,6 +226,12 @@
 1.0.0.GA
 
 
+javax.validation
+validation-api
+1.0.0.GA
+source
+
+
 cglib
 cglib-nodep
 2.2
===
--- /trunk/tools/benchmark-viewer/build.xml Tue Oct 13 16:57:19 2009
+++ /trunk/tools/benchmark-viewer/build.xml Fri Feb 11 11:12:39 2011
@@ -60,6 +60,8 @@
   
 
 
+location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar"/>
+location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar"/>

   
   
   
===
--- /trunk/user/src/com/google/gwt/user/tools/.classpathsrc	Wed Oct 13  
05:26:50 2010
+++ /trunk/user/src/com/google/gwt/user/tools/.classpathsrc	Fri Feb 11  
11:12:39 2011

@@ -3,6 +3,8 @@
@eclipseTestDir


+   
+   
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>


===
--- /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java	Fri Oct 22  
10:36:00 2010
+++ /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java	Fri Feb 11  
11:12:39 2011

@@ -308,6 +308,8 @@
 // GWT libraries
 String gwtUserPath = installPath + '/' + "gwt-user.jar";
 String gwtDevPath = installPath + '/' + "gwt-dev.jar";
+String gwtValidationPath = installPath + '/'  
+ "validation-api-1.0.0.GA.jar";
+String gwtValidationSourcesPath = installPath + '/'  
+ "validation-api-1.0.0.GA-sources.jar";


 // Public builds generate a DTD reference.
 String gwtModuleDtd = "";
@@ -358,6 +360,8 @@
 replacements.put("@gwtSdk", installPath);
 replacements.put("@gwtUserPath", gwtUserPath);
 replacements.put("@gwtDevPath", gwtDevPath);
+replacements.put("@gwtValidationPath", gwtValidationPath);
+replacements.put("@gwtValidationSourcesPath",  
gwtValidationSourcesPath);

 replacements.put("@gwtVersion", About.getGwtVersionNum());
 replacements.put("@gwtModuleDtd", gwtModuleDtd);
 replacements.put("@shellClass", DevMode.class.getName());
===
--- /trunk/user/src/com/google/gwt/user/tools/project.ant.xmlsrc	Fri Oct 22  
10:36:00 2010
+++ /trunk/user/src/com/google/gwt/user/tools/project.ant.xmlsrc	Fri Feb 11  
11:12:39 2011

@@ -39,6 +39,8 @@
   
 
 
+
+
   
   

   

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