1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 23:05:47 +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) { if (length == 0) {
locations= EMPTY_LOCATION_ARRAY; locations= EMPTY_LOCATION_ARRAY;
} }
final IASTTranslationUnit tu= getTranslationUnit(); else {
if (tu != null) { final IASTTranslationUnit tu= getTranslationUnit();
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 (tu != null) {
if (l != 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);
locations= l.getLocations(offset, length); if (l != null) {
} locations= l.getLocations(offset, length);
} }
}
}
return locations; return locations;
} }