Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
突然之间,Xtend 生成的 Java 类似乎包含了无效的语法。
例如:
public Long getEntityId() { return ??field.simpleName??; }
以前正确生成语法的地方:
public Long getEntityId() { return entityId; }
我没有更改与此类或处理器相关的任何内容 - 我只是从源代码管理中进行了更新。
这是因为 Xtend 类的编码设置为 ASCII,而不是 IDE 中的 UTF-8。
结果,下面的代码(以UTF-8编码显示)
body = [''' return «field.simpleName»;'''
变为以下(以 ASCII 编码显示
body = [''' return ��field.simpleName��;''']
确保项目的默认设置为 UTF-8: