Closed eartvit closed 6 years ago
Hi! Please move this to https://github.com/javaparser/javaparser/issues because this project is now part of the main project :-)
Okay, well, don't know how to "move" it so I closed it here and opened it on the other tracker...
Hi, I am trying to find out if a NameExpr resolves to a primitive type or not. In general it finds out type with the exception of unchecked types.
For example, trying to find out the the resolved type for the IfStmt:
if (ind != numSamples) { samples.set(ind, key); }
on line 194 of InputSampler.java from Hadoop branch 3.0.0 always crashes (it enters an infinite loop on JavaParserFactory line 114:return getContext(parentNode, typeSolver);
The complete input file (inside Hadoop branch 3.0.0) is hadoop-branch-3.0.0/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/lib/InputSampler.java
Is there a way around this problem?
I am trying to resolve the type using the below approach:
SymbolReference<? extends ResolvedValueDeclaration> rRef = JavaParserFacade .get(new ReflectionTypeSolver()).solve(n.getName());
where n is the left or right expression of an IfStmt...As I said, it works in all my other cases, except the above...
Thanks in advance for any advice or perhaps a bug fix?