// copy markers
IWorkspaceRoot resource = ResourcesPlugin.getWorkspace().getRoot();
try {
IMarker[] markers = resource.findMarkers(null, true,
IResource.DEPTH_ZERO);
final IBreakpointManager breakpointManager = DebugPlugin
.getDefault().getBreakpointManager();
for (IMarker marker : markers) {
String markerType = MarkerUtilities.getMarkerType(marker);
if (markerType != null) {
String fileName = (String) marker
.getAttribute(StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY);
if (fileName != null && new File(fileName).equals(oldFile)) {
IBreakpoint breakpoint = breakpointManager
.getBreakpoint(marker);
if (breakpoint != null) {
if (newFile != null) {
IMarker createdMarker = newFile
.createMarker(markerType);
createdMarker.setAttributes(breakpoint
.getMarker().getAttributes());
breakpointManager.removeBreakpoint(breakpoint,
true);
breakpoint.setMarker(createdMarker);
breakpointManager.addBreakpoint(breakpoint);
} else {
breakpointManager.removeBreakpoint(breakpoint,
true);
}
} else {
if (newFile != null) {
MarkerUtilities.createMarker(newFile, marker