java - Eclipse 忽略条件断点(java for hadoop)
问题描述
这是我的java代码:
public class MoviesReviewsMapper extends Mapper <LongWritable, Text, Text, Text>
{
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException
{
String [] tokens = value.toString().split("::");
context.write(new Text(tokens[2]), new Text(tokens[0]));
}
}
这是一个条件断点:
Eciplse/SDK 的版本是 v4.7.0。有什么问题?
解决方案
像这样比较你的字符串:
"1".equals(tokens[2])
问题是您正在比较变量引用,而不是对象本身。
推荐阅读
- java - 一个类的HashMap和一个类的ArrayList
- php - 创建一个小的项目数据库,能够从网络浏览器中签出和返回?
- office365 - 尝试获取 Office 365 组的元数据时出现奇怪的 403 错误
- ios - 添加弹出窗口时出现NSInternalInconsistencyException
- javascript - 错误 500,AJAX 到 PHP 使用 $_POST
- facebook - Facebook Graph API:无需离开您的应用即可分享到用户的时间线
- yeoman - 如何使用 createDummyGenerator() 函数?
- c# - 使用属性从 MVC 控制器重定向到外部 URL
- c# - 两个嵌套的实体框架上下文,共享一个事务
- azure - 检查 Azure 服务总线名称是否唯一