Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Null is given for static call from resolveTypeBinding
Null is given for static call from resolveTypeBinding [message #1718739] Tue, 29 December 2015 11:06 Go to next message
Eclipse UserFriend
Hi, I have the code
package com.test;
import com.test.Test2;

public class Test1
{    
    public void test()
    {
        return Test2.do123();
    }
}


So when I call resolveTypeBinding for Test2, I receive null. I don't understand why, I should get com.test.Test2 (I even made import for it). How it solve the problem? Thanks
Re: Null is given for static call from resolveTypeBinding [message #1718742 is a reply to message #1718739] Tue, 29 December 2015 11:32 Go to previous messageGo to next message
Eclipse UserFriend
Did you create your parser with setResolveBindings(true) ?
Re: Null is given for static call from resolveTypeBinding [message #1718743 is a reply to message #1718742] Tue, 29 December 2015 11:43 Go to previous messageGo to next message
Eclipse UserFriend
Sure.
Re: Null is given for static call from resolveTypeBinding [message #1718746 is a reply to message #1718743] Tue, 29 December 2015 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Is Test2 in your project, right next to Test1? Does it compile? Does it have a do123() method? Is it static?

When you "call resolveTypeBinding for Test2", what exactly are you calling it on? A SimpleName? in the import statement or the return statement?

You're asking us to guess, basically. There's something wrong on your end, but it could be any number of things. More information would be good.
Re: Null is given for static call from resolveTypeBinding [message #1718747 is a reply to message #1718746] Tue, 29 December 2015 12:23 Go to previous messageGo to next message
Eclipse UserFriend
It looks like that I have problems with setting up my parser.
This is my code
parser.setEnvironment(getProjectJars(), getSrcPaths(), null, true);

So, I add to classpaths only my attached jars, but not code paths as well. Am I right, I should add all paths here beginning from the root and up to the end of each path (directory path if we talk how it's represented in the filesystem).
For example, I have
C:\src

my root. And
C:\src\com\test\Test1.java
C:\src\com\test\Test2.java

my source files. I should add to classpath only
C:\src\com\test
?
Re: Null is given for static call from resolveTypeBinding [message #1718759 is a reply to message #1718747] Tue, 29 December 2015 15:29 Go to previous messageGo to next message
Eclipse UserFriend
Well, it's worth a shot. As an alternative I would try
C:\src
Re: Null is given for static call from resolveTypeBinding [message #1718809 is a reply to message #1718759] Wed, 30 December 2015 10:41 Go to previous message
Eclipse UserFriend
Yes, that works now, thanks!
Previous Topic:How JDT implement drag and drop actions to views
Next Topic:Generic JDBC Connections?
Goto Forum:
  


Current Time: Sat Jul 05 05:44:03 EDT 2025

Powered by FUDForum. Page generated in 0.03597 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top