Bug 6408 Attempts to set breakpoint on unsaved resource fails
Create an empty class call Test Paste in: public static void main(String[] args) { while(true) { try { throwIt(); } catch (Exception e) { } } } public static void throwIt() throws InterruptedException { while(true) { Thread.yield(); } } Do NOT save Attempt to add a breakpoint on the Thread.yield() line We silently do not add the breakpoint.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
* @see MarkerRulerAction#addMarker
	 */
	protected void addMarker() {
		
		IEditorInput editorInput= getTextEditor().getEditorInput();
		
		IDocument document= getDocument();
		int rulerLine= getVerticalRuler().getLineOfLastMouseButtonActivity();
		
		try {
			BreakpointLocationVerifier bv = new BreakpointLocationVerifier();
			int lineNumber = bv.getValidBreakpointLocation(document, rulerLine);
			if (lineNumber > 0) {
				
				IRegion line= document.getLineInformation(lineNumber - 1);
				
				IType type = null;
				if (editorInput instanceof IClassFileEditorInput) {
					IClassFileEditorInput input= (IClassFileEditorInput) editorInput;
					type = input.getClassFile().getType();
				} else if (editorInput instanceof IFileEditorInput) {
					IFileEditorInput input= (IFileEditorInput) editorInput;
					ICompilationUnit cu = (ICompilationUnit) JavaCore.create(input.getFile());
					IJavaElement e = cu.getElementAt(line.getOffset());
					if (e instanceof IType) 
						type = (IType)e;
					else if (e != null && e instanceof IMember) {
						type = ((IMember)e).getDeclaringType();
					}
				}