Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:06 Go to next message
Ivan Ivan is currently offline Ivan IvanFriend
Messages: 57
Registered: May 2015
Member
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 16:32 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
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 16:43 Go to previous messageGo to next message
Ivan Ivan is currently offline Ivan IvanFriend
Messages: 57
Registered: May 2015
Member
Sure.
Re: Null is given for static call from resolveTypeBinding [message #1718746 is a reply to message #1718743] Tue, 29 December 2015 16:55 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
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 17:23 Go to previous messageGo to next message
Ivan Ivan is currently offline Ivan IvanFriend
Messages: 57
Registered: May 2015
Member
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 20:29 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
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 15:41 Go to previous message
Ivan Ivan is currently offline Ivan IvanFriend
Messages: 57
Registered: May 2015
Member
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: Mon Sep 23 18:21:18 GMT 2024

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

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

Back to the top