Re: [gwt-contrib] dependencies/qualified refs

2011-09-12 Thread Stephen Haberman

 The simple and qualified references answer the question What
 references do I depend on to correctly parse and resolve the source
 code?
 
 Api refs answer the question What program elements do I need to
 construct a TypeOracle representation of this class?

Ah, okay, that makes sense.

I found a way to convert the qualified ref compound-but-source
names to internal names without a buildFromApiRefs-type hack, so
this isn't relevant to the lessnamemangling patch anymore, but
I can nonetheless go back and fix the JribbleAstBuilder
appropriately.

Thanks!

- Stephen

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


Re: [gwt-contrib] dependencies/qualified refs

2011-09-12 Thread Stephen Haberman

 The simple and qualified references answer the question What
 references do I depend on to correctly parse and resolve the source
 code?

Okay, so I do have a question about these. Debugging the ecj behavior, I
was looking at the output for some class in the c.g.g.u.client.rpc.core
(abbreviated hereafter as foo.core) package, which imports a java.math
BigDecimal, and was seeing:

* Simple refs of [math, java, core, rpc, client, user, gwt, ...]
* Qualified refs of [foo.core.java.math, foo.core.java, ...]

But, why is just math in the simple list?

And why is foo.core.java.math is in the qualified list?

AFAIU, even if a new java.lang.math or foo.core.java.math entry was
introduced, I don't see how either would change the resolution of the
current class's import java.math.BigDecimal, and so it shouldn't need
invalidated/recompiled?

- Stephen

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


Re: [gwt-contrib] dependencies/qualified refs

2011-09-07 Thread Ray Ryan
Scott says:

Stephen misunderstands what Dependencies.apiRefs means (which isn't
suprising, it's not well commented).

The simple and qualified references answer the question What references do
I depend on to correctly parse and resolve the source code?

Api refs answer the question What program elements do I need to construct a
TypeOracle representation of this class?

In other words, api refs only include things like superclass, implemented
interfaces, method parameter and return types, field types, etc.  Things you
have to have to construct a valid TypeOracle representation.  Method bodies
do not contribute to this list at all.

Simple and qualified references is generally a superset of that, includes
anything references in method bodies.

On Wed, Sep 7, 2011 at 8:52 AM, Stephen Haberman stephen.haber...@gmail.com
 wrote:

 Hi,

 There was one place in the name mangling that I had to leave an ugly
 replacement:


 https://github.com/stephenh/scalagwt-gwt/blob/embed/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java#L109

 allValidClasses is by internal name now, but the qualified references
 coming from ecj are by source name.

 (Hm, if these are top-level only units, then a simple replacement would
 be okay.  Does anyone know if that is the case, off the top of their
 heads? I'll fire up the debugger later and see if I can tell.)

 But the other reason I ask on the list instead of in the review is that,
 for scalagwt itself, I don't have these ecj data structures, so I'm
 inferring the simple and qualified refs from the api refs:


 https://github.com/stephenh/scalagwt-gwt/blob/embed/dev/core/src/com/google/gwt/dev/javac/Dependencies.java#L62

 I'm pretty sure this approach is okay, but my concern is that, poking
 around in the debugger, ecj, ends up with a whole lot more strings as
 simple/qualified refs than my current, albeit somewhat naive approach
 in buildFromApiRefs.

 Given I'd already written buildFromApiRefs, I was tempted to use it
 for the .java files as well, since api refs are already internal names,
 and then I could remove the source - internal mangling. But I didn't
 have enough confidence to do that just yet.

 If anyone could comment on buildFromApiRefs, both in theory and the
 current implementation, just for scalagwt but also whether it's
 potentially usable for the java side, I'd appreciate it.

 But I'll nonetheless look into whether the qualifiedReferences are
 only top-level units, in which case the name mangling should be okay.
 I didn't think of that until just now.

 - Stephen


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


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