Re: Compilation error

2010-01-08 Thread dangle
I rebuilt the toolkit from source and narrowed down the issue a bit
myself, definitely seems to have something to do with inner classes
being defined inside generic classes.  Unfortunately my codebase is
pretty big and we do this in multiple spots, so I'm still trying to
get around it.  Will see if i can make similar changes to what Raman
has done... but I think that the code around this part of resolving
generic types could use a little more error handling to identify these
cases at least, because without compiling from source with my own
debug statements I wasn't even able to figure out which classes it
first started complaining about.

cheers
Dan

On Jan 8, 4:23 am, Raman rama...@gmail.com wrote:
 Looks like I have finally solved the problem.

 The case was something like this.
 I am using ExtGWT which has a class TreePanel with an inner class
 TreeNode, which looks like below:

 public class TreePanelM extends ModelData {

 
 -
     class TreeNode {
       
       ---
       private M data;
     }
 --

 }

 And, since the TreeNode class is public inside TreePanel, I was
 directly using TreeNode class in my code.

 I would do:

 import ..TrePanel.TreeNode;
 -
 --

 TreeNode node = ;

 As you can see, TreeNode internally uses the type M, which is not
 defined in the above kind of usage.
 And GWT compiler gets confused when it sees this.

 I solved this problem by removing the import statement as accessing
 the TreeNode only in the context of the outer class(TreePanel) like
 this:

 TreePanelMyModeldata.TreeNode node = x;

 This solved the issue.
-- 
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.




Re: Compilation error

2010-01-08 Thread dangle
As a temporary workaround since I've already burned a whole day on
this one, I just refactored several inner classes to the top level.
It just compiled.

I think my case may have actually done something similar, only where
(to use Raman's example) it actually defined TreePanel.TreeNode as
part of a method signature, without specifying any type on the
parent...

This stuff all used to compile fine, so hopefully my other projects
don't require too much refactoring, but at least there seem to be ways
to work around it.  Thanks for the post, Raman.

Dan

On Jan 8, 4:23 am, Raman rama...@gmail.com wrote:
 Looks like I have finally solved the problem.

 The case was something like this.
 I am using ExtGWT which has a class TreePanel with an inner class
 TreeNode, which looks like below:

 public class TreePanelM extends ModelData {

 
 -
     class TreeNode {
       
       ---
       private M data;
     }
 --

 }

 And, since the TreeNode class is public inside TreePanel, I was
 directly using TreeNode class in my code.

 I would do:

 import ..TrePanel.TreeNode;
 -
 --

 TreeNode node = ;

 As you can see, TreeNode internally uses the type M, which is not
 defined in the above kind of usage.
 And GWT compiler gets confused when it sees this.

 I solved this problem by removing the import statement as accessing
 the TreeNode only in the context of the outer class(TreePanel) like
 this:

 TreePanelMyModeldata.TreeNode node = x;

 This solved the issue.
-- 
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.




Re: Compilation error

2010-01-07 Thread dangle
I just got the same error on one project, although I've successfully
been able to compile others.  No idea why yet... anyone have any
ideas?


On Jan 7, 12:28 am, Raman rama...@gmail.com wrote:
 I just upgraded to GWT 2.0.
 But when I compile my source code with com.google.gwt.dev.Compiler, I
 get a NullPointerException as below. What am I doing wrong?

 [ERROR] Unexpected
 java.lang.NullPointerException
         at
 com.google.gwt.dev.javac.asm.ResolveTypeSignature.mergeTypeParamBound
 s(ResolveTypeSignature.java:229)
         at
 com.google.gwt.dev.javac.asm.ResolveTypeSignature.resolveGeneric(Reso
 lveTypeSignature.java:300)
         at
 com.google.gwt.dev.javac.asm.ResolveTypeSignature.resolveGeneric(Reso
 lveTypeSignature.java:297)
         at
 com.google.gwt.dev.javac.asm.ResolveTypeSignature.resolveGenerics(Res
 olveTypeSignature.java:339)
         at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitEnd
 (ResolveTyp
 eSignature.java:155)
         at com.google.gwt.dev.asm.signature.SignatureReader.parseType
 (SignatureR
 eader.java:188)
         at com.google.gwt.dev.asm.signature.SignatureReader.accept
 (SignatureRead
 er.java:100)
         at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod
 (TypeOracleM
 ediator.java:972)
         at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass
 (TypeOracleMe
 diator.java:767)
         at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass
 (TypeOracleMe
 diator.java:792)
         at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass
 (TypeOracleMe
 diator.java:698)
         at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits
 (TypeOracleMed
 iator.java:353)
         at com.google.gwt.dev.javac.CompilationState.assimilateUnits
 (Compilation
 State.java:135)
         at com.google.gwt.dev.javac.CompilationState.init
 (CompilationState.jav
 a:79)
         at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom
 (Compilat
 ionStateBuilder.java:284)
         at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom
 (Compilatio
 nStateBuilder.java:181)
         at com.google.gwt.dev.cfg.ModuleDef.getCompilationState
 (ModuleDef.java:2
 80)
         at com.google.gwt.dev.Precompile.precompile(Precompile.java:
 502)
         at com.google.gwt.dev.Precompile.precompile(Precompile.java:
 414)
         at com.google.gwt.dev.Compiler.run(Compiler.java:201)
         at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
         at com.google.gwt.dev.CompileTaskRunner.doRun
 (CompileTaskRunner.java:87)

         at
 com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(Compile
 TaskRunner.java:81)
         at com.google.gwt.dev.Compiler.main(Compiler.java:159)
-- 
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.