解决eclipse偶尔无视breakpoint的行为
一般是如果你使用了T[]这样的参数列表,也就是generic array作为参数,你就算给函数打了断点,有时也会被eclipse无视
比如如下代码,你在调试main的时候,eclipse就会把doPartition(T[],int,int)上的断点无视了,也就是说,如果你在main中按F6(step over),是不会进入doPartition(T[],int,int),除非你按F5(step into)强行进入下一层
但是如果你把doPartition(T[],int,int)的断点不要打在函数头上,在函数体的第一句打上断点,就可以解决这个问题(也就是说把断点打在int i = 0那一行)
无解,遇到这种情况只能把函数体内的每一个句子都打上断点,否则没法调试,上面说的只给第一句打上断点确实能够强迫eclipse进入函数调试,但是函数中如果有子循环,就不会单步了,子循环会一下子执行完毕,所以,感觉这个是eclipse的一个bug,目前惟一的解决方案就是给函数中的每个句子都打上断点,用鼠标双击代码窗口的左侧就可以勾选/取消断点。
package test;
import algorithms.Xxx;
public class TestPartition {
public static void main(String[] args) { // 断点打在这一行
int pivot = 0;
String[] ss = new String[]{"a","b"};
pivot++;
pivot++;
Xxx.doPartition(ss, 1, 2);
pivot++;
pivot++;
Xxx.doPartition(1, 2);
pivot++;
pivot++;
}
}
package algorithms;
public class Xxx {
public static <T extends Comparable<T>> int doPartition(T[] arr, int m, int n) { // 断点打在这一行
int i = 0;
++i;
++i;
++i;
return i;
}
public static <T extends Comparable<T>> int doPartition(int m, int n) { // 断点打在这一行
int i = 0;
++i;
++i;
++i;
return i;
}
}
解决eclipse偶尔无视breakpoint的行为的更多相关文章
- 解决eclipse中断点调试不起作用的问题
解决eclipse中断点调试不起作用的问题 eclipsegeneration编译器file工作 最近几天,遇到了一个问题,就是在eclipse中进行断点调试程序到时候,跟踪不到我设置的断点.困惑 ...
- 解决eclipse中自带的maven搜索不到非本地第三方包问题
解决eclipse中自带的maven搜索不到非本地第三方包问题 版权声明:本文为博主原创文章,未经博主允许不得转载. 最近使用eclipse中的maven插件时发现,在pom.xml文件中添加第 ...
- 解决Eclipse中文乱码 - 技术博客 - 51CTO技术博客 http://hsj69106.blog.51cto.com/1017401/595598/
解决Eclipse中文乱码 - 技术博客 - 51CTO技术博客 http://hsj69106.blog.51cto.com/1017401/595598/
- Eclipse 在ubuntu桌面显示快捷启动以及解决Eclipse 在ubuntu中点击菜单栏不起作用的原因.
要在Eclipse中设置好之后,可以通过如下方式在周末显示快捷启动以及解决Eclipse在ubuntu高版本中点击菜单栏项不显示列表的问题 在usr/share/app-install/desktop ...
- 彻底解决Eclipse自动补全变量名及变量名后面追加类型名
彻底解决Eclipse自动补全变量名问题的方法步骤 发布于 2014-11-04 14:53 已被阅读 31613159 次 大家使用eclipse或者MyEclipse敲代码的时候,是不是都被这 ...
- 解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element
解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element 'beans'.Referenced file conta ...
- 解决eclipse中出现Resource is out of sync with the file system问题
解决eclipse中出现Resource is out of sync with the file system问题 . 分类: 嵌入式开发平台和环境相关 2011-12-27 16:18 4872人 ...
- 解决eclipse闪退的办法
Eclipse Java EE 便出现打开闪退的现象. 修改eclipse.ini无效,参照了网上许多方法也不行. 最后发现了一个蛋疼的方法: 1.打开eclipse的workspace目录 2.删除 ...
- 解决Eclipse中编辑xml文件的智能提示问题,最简单的是第二种方法。
Eclipse for Android xml 文件代码自动提示功能,介绍Eclipse 编辑器中实现xml 文件代码自动智能提示功能,解决eclipse 代码提示失效.eclipse 不能自动提示. ...
随机推荐
- Jenkins的slave异常:Exception in thread "main" java.lang.ClassNotFoundException: hudson.remoting.Launcher
当任务分配到slave上执行时,报如下错误: Parsing POMs Established TCP socket on 38257 maven33-agent.jar already up to ...
- CKFinder根据用户设置权限,不同用户有自己的私有的、独立的文件夹
CKFinder 默认情况下多个用户共用同一个图片目录.所有上传的图片和Flash全部保存在同一个文件夹(默认为 userfiles)内. 现在想实现: 第1个需求:不同用户有自己的私 ...
- 使用weinre调试手机页面
阅读目录 介绍Weinre 安装Weinre 通过Weinre调试页面 启动target 介绍Weinre Weinre(Web Inspector Remote),是一种远程调试工具.功能与Fire ...
- C++静态库与动态库详解
1 库的概念? 库是写好的现有的,成熟的,可以复用的代码.现实中每个程序都要依赖很多基础的底层库. 2 动态库与静态库的概念? 先回顾一下编译过程: 2.1 静态库 静态库在链接阶段,会将汇编生成的目 ...
- jQuery.toggleClass() 和detach()方法详解
一.toggleClass()函数: toggleClass()函数用于切换当前jQuery对象所匹配的每一个元素上指定的css类名.所谓"切换",就是如果该元素上已存在指定的类名 ...
- DevExpress 中 用 LookUpEdit 控件 代替 ComboBoxEdit 控件来绑定 DataTable
绑定数据及定义列信息 LookUpEdit lue = lookUpEdit1; DataTable dt = new DataTable(); dt.Columns.Add(new DataColu ...
- yaha分词
yaha分词:https://github.com/jannson/yaha
- hdu1227 Fast Food
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=1227 #include <iostream> #include <cstdio&g ...
- Fedora 中的容器技术:systemd-nspawn
本文将说明你可以怎样使用 Fedora 中各种可用的容器技术和学习“systemd-nspawn”的相关知识. 容器是什么? 一个容器就是一个用户空间实例,它能够在与托管容器的系统(叫做宿主系统)相隔 ...
- Junit测试Spring应用Dubbo测试框架之-Excel 工具类
package com.tree.autotest.demo; import com.alibaba.fastjson.JSON;import org.apache.poi.hssf.usermode ...