javaparser / javasymbolsolver

*old repository* --> this is now integrated in https://github.com/javaparser/javaparser
Apache License 2.0
290 stars 76 forks source link

Failing to resolve type of some method call receiver expressions #372

Closed parvez2014 closed 6 years ago

parvez2014 commented 6 years ago

I am using JSS to resolve the type of method call receiver expression. During testing I observed that in a few places JSS failed to resolve type:

  1. where the type is defined in the jar file: Code: //convert the output into list of lines List lineList = IOUtils.readLines(new StringReader(output));

JSS failed to resolve the the type of IOUtils for the method call IOUtils.readLines(...) IOUtils is defined Apache commons-io-2.6.jar (I have included the jar file path to my CombinedTypeSolver using a JarTypeSolver)

I have used the following command to resolve receiver expression of a method call: ResolvedType resolvedType = JavaParserFacade.get(c.getType(m.getScope().get()); Here, c is an instance of CombinedTypeSolver and m is a an instance of MethodCallexpr

  1. In some cases if the type is defined in a source code: Code: String output = ProcessUtility.output(process.getInputStream());

I have defined the ProcessUtility class but JSS failed to resolve type of ProcessUtility for the method call: ProcessUtility.output I have added all the source code of the project (including the ProcessUtility.java) in my CombinedTypeSolver using a JavaParserTypeSolver.

Any suggestion would be really helpful. Thanks.

parvez2014 commented 6 years ago

I found that all new issues of JSS should be asked in the JavaParser project. Should I ask the question there and close this one? Please let me know. Thanks.

matozoid commented 6 years ago

Please do so.