1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 22:35:43 +02:00

Follow up for deprecated methods in IASTTranslationUnit.

This commit is contained in:
Markus Schorn 2007-11-06 18:06:53 +00:00
parent b3d789e035
commit 439c8752eb

View file

@ -85,13 +85,15 @@ public abstract class ASTNode implements IASTNode {
if (length == 0) {
locations= EMPTY_LOCATION_ARRAY;
}
final IASTTranslationUnit tu= getTranslationUnit();
if (tu != null) {
org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver l= (org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver) tu.getAdapter(org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver.class);
if (l != null) {
locations= l.getLocations(offset, length);
}
}
else {
final IASTTranslationUnit tu= getTranslationUnit();
if (tu != null) {
org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver l= (org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver) tu.getAdapter(org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver.class);
if (l != null) {
locations= l.getLocations(offset, length);
}
}
}
return locations;
}