Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: gen.java | QUALIFIED_NAME 类型的 ASTNode 节点缺少 reference 边连接类静态变量 #131

Open
Guitenbay opened this issue Jun 22, 2022 · 0 comments

Comments

@Guitenbay
Copy link

对于以下情况 gen.java 不能处理:
src/Main.java

public static void main(String[] args) {
    ...
    Global.LOGS.add("TEST");
}

src/Global.java

public class Global {
    public static List<String> LOGS = new ArrayList<>(Arrays.asList("<GLOBAL LOGS>", "--------------"));
    ...
}

Main.javaGlobal.LOGS 链接不到 Global.java 的静态变量 LOGS

原因是 gen.java 里的 edu.pku.code2graph.gen.jdt.ExpressionVisitor.java 第 1095 行:

case ASTNode.QUALIFIED_NAME:
      {
        QualifiedName name = (QualifiedName) exp;
        root.setType(NodeType.QUALIFIED_NAME);
        root.setUri(createIdentifier(name.getFullyQualifiedName()));
        GraphUtil.addNode(root);
        break;
      }

缺少对 ((QualifiedName) exp).getName() 这个SimpleName节点的处理

解决方案:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant