Last active
April 5, 2017 18:02
-
-
Save xdrop/29fb2f010eed8612512a336bd120762f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CompilationUnit cu = parseSample("Issue174"); | |
ClassOrInterfaceDeclaration clazz = Navigator.demandClass(cu, "PragmaInstr"); | |
MethodCallExpr fileChanged = Navigator.findMethodCall(clazz, "fileChanged"); | |
Expression argument = fileChanged.getArgument(0); | |
TypeSolver typeSolver = new ReflectionTypeSolver(); | |
JavaParserFacade javaParserFacade = JavaParserFacade.get(typeSolver); | |
assertEquals(true, javaParserFacade.solve(fileChanged, false).isSolved()); | |
assertEquals("java.lang.String", javaParserFacade.getType(argument).describe()); | |
/* Issue174 | |
class PragmaInstr { | |
int placement; | |
String idPragma; | |
void process() { | |
switch (placement) { | |
case 3: | |
String a = idPragma; | |
fileChanged(idPragma); | |
} | |
} | |
static void fileChanged( String msg) { | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment