Eclipse告诉我一个方法在明确实际定义时是未定义的 [英] Eclipse is telling me a method is undefined when it clearly is in fact defined

查看:1046
本文介绍了Eclipse告诉我一个方法在明确实际定义时是未定义的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在RAD 7.5工作。我正在将一个包从一个Web项目导入到另一个Web项目中。我实例化该类并尝试使用其中一个方法,但是我得到一个构建错误,该方法未定义。该方法是公开的。除此之外,所有其他方法都有效。我正在导入的项目是正确构建的。我已经尝试删除这两个项目,再次从版本控制中抓取它们,然后重建它们。究竟是什么问题或者我可以在日食中检查什么(RAD 7.5)?

I'm working in RAD 7.5. I'm importing a package from one web project into another. I instantiate the class and try to use one of its method, but I get a build error that the method is undefined. The method is public. All other methods work except this one. The project from which I'm importing is built properly. I've tried deleting both projects, grabbing them from version control again, and rebuilding them. What on earth could possible be the problem or what else can I check in eclipse (RAD 7.5)?

其他信息:

被调用的方法不是静态的。它是公开的,并且是通过非静态,受保护的方法调用的。

The method being called is not static. It is public and being called from a not static, protected, method.

代码段

我正在导入的课程:

package com.state;

public TelcoVariableTracker() {
    super();
}

public boolean isMedicalFlag() {
    return isMedicalFlag;
}

包含构建错误的类:

import com.state.TelcoVariableTracker;

protected method() {

TelcoVariableTracker phoneInfo = HttpSessionUtils.getTelcoVariableTracker(request);

    if (phoneInfo.isMedicalFlag() {  // Build error: The method isMedicalFlag() is undefined for the type TelcoVariableTracker
        // Do things
    }
}


推荐答案

我有同样的问题,清理项目做了诀窍:)

I had same issue, Cleaning the project did the trick :)

这篇关于Eclipse告诉我一个方法在明确实际定义时是未定义的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆