認真讀文檔!

認真讀文檔!
認真讀文檔!
認真讀文檔!

血的教訓....

// ignored some codes ...
Map options = JavaCore.getOptions();
JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
parser.setCompilerOptions(options);
  • Which compiler options to use. This is especially important to use if the parsing/scanning of the source code requires a different version than the default of the workspace. For example, the workspace defaults are 1.4 and you want to create an AST for a source code that is using 1.5 constructs.

References

Eclipse JDT ASTParser convert enum declaration node incorrectly

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章