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
IBreakpoint breakpoint= breakpointManager.getBreakpoint((IMarker) e.next());
				breakpointManager.removeBreakpoint(breakpoint, true);
			}
			
		} catch (CoreException e) {
			Shell shell= getTextEditor().getSite().getShell();
			ErrorDialog.openError(shell, JavaEditorMessages.getString("ManageBreakpoints.error.removing.title1"), JavaEditorMessages.getString("ManageBreakpoints.error.removing.message1"), e.getStatus()); 
		}
	}
	
	/**
	 * Returns the resource on which a breakpoint marker should
	 * be created for the given member. The resource returned is the 
	 * associated file, or project in the case of a class file in 
	 * a jar.
	 * 
	 * @param member member in which a breakpoint is being created
	 * @return resource the resource on which a breakpoint marker
	 *  should be created
	 * @exception CoreException if an exception occurrs accessing the
	 *  underlying resource or Java model elements
	 */
	public IResource getBreakpointResource(IMember member) throws CoreException {
		IResource res = member.getUnderlyingResource();
		if (res == null) {
			res = member.getJavaProject().getProject();
		}
		return res;
	}	
}