1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

Avoid usage of getPath() - related to bug 218266

This commit is contained in:
Anton Leherbauer 2008-02-14 08:10:43 +00:00
parent a3aab7e451
commit 86529c7688
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2007 QNX Software Systems and others. * Copyright (c) 2004, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -175,7 +175,7 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
} }
if ( element instanceof ExternalTranslationUnit ) { if ( element instanceof ExternalTranslationUnit ) {
ExternalTranslationUnit etu = (ExternalTranslationUnit) element; ExternalTranslationUnit etu = (ExternalTranslationUnit) element;
return new ExternalEditorInput( etu , new LocalFileStorage( etu.getPath().toFile() ) ); return new ExternalEditorInput( etu , new LocalFileStorage( etu.getLocation().toFile() ) );
} }
if (element instanceof CSourceNotFoundElement) if (element instanceof CSourceNotFoundElement)
{ {

View file

@ -364,10 +364,10 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
private String getSourceHandle( IDeclaration declaration ) { private String getSourceHandle( IDeclaration declaration ) {
ITranslationUnit tu = declaration.getTranslationUnit(); ITranslationUnit tu = declaration.getTranslationUnit();
if ( tu != null ) { if ( tu != null ) {
IResource resource = tu.getResource(); IPath location = tu.getLocation();
if ( resource != null ) if (location != null) {
return resource.getLocation().toOSString(); return location.toOSString();
return tu.getPath().toOSString(); }
} }
return ""; //$NON-NLS-1$ return ""; //$NON-NLS-1$
} }