我正在尝试从此站点学习 Eclipse 编辑器注释:
http://www.ibm.com/developerworks/opensource/tutorials/os-eclipse-plugin-guide
这似乎是一个非常好的教程,但是我复制到 Eclipse 工作区的任何代码,它总是显示错误“一行中有多个标记”
例如,当我复制以下代码时:
public static IMarker createMarker(IResource res)
throws CoreException {
IMarker marker = null;
//note: you use the id that is defined in your plugin.xml
marker = res.createMarker("com.ibm.mymarkers.mymarker");
marker.setAttribute("description," "this is one of my markers");
//note: you can also use attributes from your supertype
marker.setAttribute(IMarker.MESSAGE, "My Marker");
return marker;
}
我会得到一行中有多个标记的错误。你能帮我问一下吗?我对此感到非常沮丧,并且已经花了 2 个小时。
最佳答案
多个标记表示指定的行有多个错误。 我假设错误在这一行:
marker.setAttribute("description," "this is one of my markers");
请注意,放错位置的逗号 (,) 更正后的版本应为:
marker.setAttribute("description", "this is one of my markers");
尝试一下并进行干净的构建。我确信这次一定会成功。
关于java - 了解 Eclipse 编辑器中的注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25118213/