Compilers usually need full type information before they can tell, who
calls who. So this will probably add an additional compile step (or
maybe change the compiler architecture?) Still, I think your suggested
soultion uses a good approach, and you should create an entry in the
issue tracker for this.

Thinking about it, however, I personally wouldn't include this
functionality directly in the compiler: Even if it succeeds and
doesn't slow the compiler too much down, it means that the compiler
will accept classes that are partially invalid (class B could call
anything on class A, the compiler won't be able to check this, if it
decides to ignore A). This would create rather strange semantics for
"my class compiles successfully" - it depends on the question, if some
methods will be used or not.

However, I see two possible alternative solutions:

(A) Provide a pre-compiler that removes specially annotated fields. It
will be necessary to annotate the methods that access the fields
(directly or indirectly), too. Then allow GWTRPC serialization to
interact between the two versions of the class.

or (B) In addition to <source path="..."/> in the module xml, there
could be an element <source-dependency path="..."/>, which would mean:
Don't attempt to compile the java files in that path, but only read
their signature (basically treat the classes similar to interfaces).
This way, the type information can be provided to the compiler, and it
can work as usual. It would require however, that the java file is
available to you - you can't use this, if you only have the .class
files.
[In your case, getaceres, you'd add the package 'pack' to the source-
dependency path.]

I'm a lot more for (A), because it keeps semantics clean. Keep in mind
that in reality, you're trying to use different versions of the class
on the server and client. All you want is, that you don't have to
write and maintain the two similar versions (which is a legitimate
reason).


On Jan 22, 8:48 am, getaceres <getace...@gmail.com> wrote:
> Let's say that you have Class A with a transient method A.field marked
> as transient in java or with the GwtTransient annotation:
>
> - Mark field A.field and every method in A that uses field as
> unavailable.
> - If you find in the client code a class that uses A.field or any of
> the methods of A marked as unavailable, fail the compilation and
> inform the user about "Line X,Y: Use of transient method A.method".
> - Now the user either, removes the calling method from its code or
> removes the transient keyword from the field.
>
> In my case, that wold be enough since I will not ever call any of this
> getter or setters in the GWT code.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to