NetBeans中groovy的令牌错误

NetBeans中groovy的令牌错误,netbeans,groovy,titan,Netbeans,Groovy,Titan,最初,我在一个简单的文本编辑器中开发groovy代码,但我通过NetBeans设置了版本控制,因此将代码移到了另一个版本。然而,我在实际运行正常的代码上遇到了一个“意外标记”错误 class PWLoad { def conf = new BaseConfiguration() {{ setProperty("storage.backend", "cassandra") setProperty("storage.directory", "/tmp/pw")

最初,我在一个简单的文本编辑器中开发groovy代码,但我通过NetBeans设置了版本控制,因此将代码移到了另一个版本。然而,我在实际运行正常的代码上遇到了一个“意外标记”错误

class PWLoad {

def conf = new BaseConfiguration() {{
        setProperty("storage.backend", "cassandra")
        setProperty("storage.directory", "/tmp/pw")
        setProperty("storage.batch-loading", true)
}}

def g = TitanFactory.open(conf)
def mgmt = g.getManagementSystem()

//This will be generated as "feature_type:geneId"
def objectId = mgmt.makePropertyKey('objectID').dataType(String.class).unique().make()
//Type of relationship between vertices -- all pairwise for this batch load script
def pairwise = mgmt.makeEdgeLabel('pairwise').dataType(String.class).multiplicity(Multiplicity.MULTI).make()
//Identifies these objects as bioentities, as opposed to drugs or other objects we may add later
def bioentity = mgmt.makeVertexLabel('bioentity').make();

//Vertex properties
def name = mgmt.makePropertyKey('name').dataType(String.class).make()
def chr = mgmt.makePropertyKey('chr').dataType(String.class).make()
def start = mgmt.makePropertyKey('start').dataType(Integer.class).make()
def end = mgmt.makePropertyKey('end').dataType(Integer.class).make()
def strand = mgmt.makePropertyKey('strand').dataType(Character.class).make()


/*
Edge properties -- inline comment corresponds to column #:
*/
def correlation = mgmt.makePropertyKey('correlation').dataType(Decimal.class).make() //3
def sample_size = mgmt.makePropertyKey('sample_size').dataType(Decimal.class).make() //4
def min_log_p_uncorrected = mgmt.makePropertyKey('min_log_p_uncorrected').dataType(Decimal.class).make() //5
def bonferroni = mgmt.makePropertyKey('bonferroni').dataType(Decimal.class).make() //6
def min_log_p_corrected = mgmt.makePropertyKey('min_log_p_corrected').dataType(Decimal.class).make() //7
def excluded_sample_count_a = mgmt.makePropertyKey('excluded_sample_count_a').dataType(Decimal.class).make() //8
def min_log_p_unused_a = mgmt.makePropertyKey('min_log_p_unused_a').dataType(Decimal.class).make() //9
def excluded_sample_count_b = mgmt.makePropertyKey('excluded_sample_count_b').dataType(Decimal.class).make() //10
def min_log_p_unused_b = mgmt.makePropertyKey('min_log_p_unused_b').dataType(Decimal.class).make() //11
def genomic_distance = mgmt.makePropertyKey('genomic_distance').dataType(Integer.class).make() //12


//Create index of ObjectId to speed map building

mgmt.buildIndex('byObjectId', Vertex.class).addKey(objectId).unique().buildCompositeIndex()
mgmt.commit()

g.commit()
}


我在@mgmt.buildIndex()的最底部得到了令牌错误。哪里出了问题?

这可能有很多问题,但通常,意外的令牌错误意味着您可能有一个额外的逗号、空格或字符不属于那里,就像在函数调用中一样

如果您知道需要什么类型的参数
buildIndex
,则可以确定传入的字符串(即
byObjectId
)是否存在问题,或者是否未正确调用任何其他链接函数

事实上,这曾经是有效的,而现在不是,这可能意味着某些库没有被导入。我会打开NetBeans中错误的语法高亮显示,它通常会告诉您传递的内容在哪里,或者不属于那里的内容在哪里